pub struct Container {
pub id: ContainerId,
pub name: String,
pub image: String,
pub machine_name: Option<String>,
pub state: ContainerState,
pub created: DateTime<Utc>,
pub started_at: Option<DateTime<Utc>>,
pub finished_at: Option<DateTime<Utc>>,
pub exit_code: Option<i32>,
pub config: Option<ContainerConfig>,
}Expand description
Container information.
Fields§
§id: ContainerIdContainer ID.
name: StringContainer name.
image: StringImage name.
machine_name: Option<String>Machine name (VM where container runs).
state: ContainerStateCurrent state.
created: DateTime<Utc>Creation time.
started_at: Option<DateTime<Utc>>Start time (if running).
finished_at: Option<DateTime<Utc>>Finish time (if exited).
exit_code: Option<i32>Exit code (if exited).
config: Option<ContainerConfig>Container configuration (cmd, env, mounts, etc.).
Implementations§
Source§impl Container
impl Container
Sourcepub fn with_config(name: impl Into<String>, config: ContainerConfig) -> Self
pub fn with_config(name: impl Into<String>, config: ContainerConfig) -> Self
Creates a new container with configuration.
Sourcepub fn new_for_machine(
name: impl Into<String>,
image: impl Into<String>,
machine: impl Into<String>,
) -> Self
pub fn new_for_machine( name: impl Into<String>, image: impl Into<String>, machine: impl Into<String>, ) -> Self
Creates a new container for a specific machine.
Sourcepub fn with_config_for_machine(
name: impl Into<String>,
config: ContainerConfig,
machine: impl Into<String>,
) -> Self
pub fn with_config_for_machine( name: impl Into<String>, config: ContainerConfig, machine: impl Into<String>, ) -> Self
Creates a new container for a specific machine with configuration.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns whether the container is running.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Container
impl<'de> Deserialize<'de> for Container
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
Auto Trait Implementations§
impl Freeze for Container
impl RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnsafeUnpin for Container
impl UnwindSafe for Container
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