pub struct ContainerState {Show 19 fields
pub id: String,
pub name: String,
pub pid: u32,
pub command: Vec<String>,
pub started_at: u64,
pub memory_limit: Option<u64>,
pub cpu_limit: Option<u64>,
pub using_gvisor: bool,
pub rootless: bool,
pub cgroup_path: Option<String>,
pub config_hash: Option<u64>,
pub creator_uid: u32,
pub process_uid: u32,
pub process_gid: u32,
pub additional_gids: Vec<u32>,
pub start_ticks: u64,
pub status: OciStatus,
pub bundle_path: Option<String>,
pub annotations: HashMap<String, String>,
}Expand description
Container state tracking information
Fields§
§id: StringContainer ID (unique 32 hex chars, 128-bit)
name: StringContainer name (user-supplied or same as ID)
pid: u32PID of the container process
command: Vec<String>Command being executed
started_at: u64Start time (Unix timestamp)
memory_limit: Option<u64>Memory limit in bytes (None = unlimited)
cpu_limit: Option<u64>CPU limit in millicores (None = unlimited)
using_gvisor: boolWhether using gVisor runtime
rootless: boolWhether using rootless mode
cgroup_path: Option<String>cgroup path
config_hash: Option<u64>Desired topology config hash associated with this container, if any.
creator_uid: u32UID of the user who created this container
process_uid: u32Effective uid of the workload process inside the container.
process_gid: u32Effective gid of the workload process inside the container.
additional_gids: Vec<u32>Supplementary gids of the workload process inside the container.
start_ticks: u64Process start time in clock ticks (from /proc/<pid>/stat field 22)
Used to detect PID reuse in is_running()
status: OciStatusOCI container status
bundle_path: Option<String>OCI bundle path
annotations: HashMap<String, String>OCI annotations
Implementations§
Source§impl ContainerState
impl ContainerState
Sourcepub fn new(params: ContainerStateParams) -> Self
pub fn new(params: ContainerStateParams) -> Self
Create a new container state from the given parameters.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the container process is still running
Cross-checks PID start time to detect PID reuse after process exit.
Also returns false if the OCI status is Stopped.
Trait Implementations§
Source§impl Clone for ContainerState
impl Clone for ContainerState
Source§fn clone(&self) -> ContainerState
fn clone(&self) -> ContainerState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more