pub struct Container {
pub runtime: &'static str,
pub id: String,
}Expand description
What a cgroup path says about the process’s container membership.
htop decides this from cgroup membership rather than heuristics, and so do we.
The distinction that matters for a column is not “is it in a container” but
which one: container_from_cgroup returning the bare marker ("docker")
made every containerised process on the machine render the same word, which is
a boolean dressed up as data.
Fields§
§runtime: &'static strThe runtime that owns it: docker, kubepods, lxc, …
id: StringThe container’s identifier, as the cgroup path spells it.
For Docker and Podman this is the 64-hex id (or a prefix of it); for
Kubernetes it is the pod uid. Empty when the path names a runtime but no
identifiable container — a kubepods.slice with no pod below it, say.
Implementations§
Source§impl Container
impl Container
Sourcepub fn short_id(&self) -> &str
pub fn short_id(&self) -> &str
The id shortened to the first 12 characters, which is what Docker prints and enough to tell containers apart on screen.
Shortening here rather than at render time keeps the column and the inspector agreeing; it also means the sort key and the displayed text are the same string.
Trait Implementations§
impl Eq for Container
impl StructuralPartialEq for Container
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more