pub enum Status {
Creating,
Created,
Running,
Stopped,
}Expand description
Container status as defined by OCI.
Valid state transitions:
- Creating -> Created
- Created -> Running
- Running -> Stopped
- Any -> Stopped (on error)
Variants§
Creating
Container is being created.
Created
Container has been created (create command has finished).
Running
Container is running (start command has been invoked).
Stopped
Container has stopped.
Implementations§
Source§impl Status
impl Status
Sourcepub const fn can_transition_to(&self, target: Self) -> bool
pub const fn can_transition_to(&self, target: Self) -> bool
Check if transition to the given status is valid.
Sourcepub fn valid_transitions(&self) -> Vec<&'static str>
pub fn valid_transitions(&self) -> Vec<&'static str>
Get valid transitions from current status.
Sourcepub const fn is_running(&self) -> bool
pub const fn is_running(&self) -> bool
Check if container is in a running state.
Sourcepub const fn can_delete(&self) -> bool
pub const fn can_delete(&self) -> bool
Check if container can be deleted.
Trait Implementations§
impl Copy for Status
Source§impl<'de> Deserialize<'de> for Status
impl<'de> Deserialize<'de> for Status
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnsafeUnpin for Status
impl UnwindSafe for Status
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.