pub struct Bundle { /* private fields */ }Expand description
OCI bundle representation.
A bundle encapsulates an OCI runtime configuration and its associated root filesystem.
Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
Load an OCI bundle from a directory.
This reads and validates the config.json file and checks that the bundle structure is valid.
Sourcepub fn create<P: AsRef<Path>>(path: P, spec: Spec) -> Result<Self>
pub fn create<P: AsRef<Path>>(path: P, spec: Spec) -> Result<Self>
Create a new bundle from an existing spec.
This creates the bundle directory structure and writes the config.json.
Sourcepub fn create_default<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn create_default<P: AsRef<Path>>(path: P) -> Result<Self>
Create a bundle with default Linux configuration.
Sourcepub fn config_path(&self) -> PathBuf
pub fn config_path(&self) -> PathBuf
Get the config.json path.
Sourcepub fn rootfs_path(&self) -> PathBuf
pub fn rootfs_path(&self) -> PathBuf
Get the root filesystem path.
Returns the resolved absolute path to the rootfs.
Sourcepub fn rootfs_exists(&self) -> bool
pub fn rootfs_exists(&self) -> bool
Check if the rootfs exists.
Sourcepub fn rootfs_readonly(&self) -> bool
pub fn rootfs_readonly(&self) -> bool
Check if the rootfs is configured as read-only.
Sourcepub fn update_spec(&mut self, spec: Spec) -> Result<()>
pub fn update_spec(&mut self, spec: Spec) -> Result<()>
Update the spec and save.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bundle
impl RefUnwindSafe for Bundle
impl Send for Bundle
impl Sync for Bundle
impl Unpin for Bundle
impl UnsafeUnpin for Bundle
impl UnwindSafe for Bundle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more