pub struct State { /* private fields */ }Expand description
State holds information about the runtime state of the container.
Implementations§
Source§impl State
impl State
Source§impl State
impl State
Sourcepub fn version_mut(&mut self) -> &mut String
pub fn version_mut(&mut self) -> &mut String
version is the version of the specification that is supported.
Sourcepub fn status_mut(&mut self) -> &mut ContainerState
pub fn status_mut(&mut self) -> &mut ContainerState
status is the runtime status of the container.
Sourcepub fn bundle_mut(&mut self) -> &mut PathBuf
pub fn bundle_mut(&mut self) -> &mut PathBuf
bundle is the path to the container’s bundle directory.
Source§impl State
impl State
Sourcepub fn set_version(&mut self, val: String) -> &mut Self
pub fn set_version(&mut self, val: String) -> &mut Self
version is the version of the specification that is supported.
Sourcepub fn set_status(&mut self, val: ContainerState) -> &mut Self
pub fn set_status(&mut self, val: ContainerState) -> &mut Self
status is the runtime status of the container.
Sourcepub fn set_pid(&mut self, val: Option<i32>) -> &mut Self
pub fn set_pid(&mut self, val: Option<i32>) -> &mut Self
pid is the process ID for the container process.
Sourcepub fn set_bundle(&mut self, val: PathBuf) -> &mut Self
pub fn set_bundle(&mut self, val: PathBuf) -> &mut Self
bundle is the path to the container’s bundle directory.
Source§impl State
impl State
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, OciSpecError>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, OciSpecError>
Load a State from the provided JSON file path.
§Errors
This function will return an OciSpecError::Io if the file does not exist or an OciSpecError::SerDe if the JSON is invalid.
Sourcepub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), OciSpecError>
pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), OciSpecError>
Save a State to the provided JSON file path.
§Errors
This function will return an OciSpecError::Io if a file cannot be created at the provided path or an OciSpecError::SerDe if the state cannot be serialized.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)