pub struct ContainerRef {
pub container_id: String,
pub uid: u32,
pub cgroup: Option<String>,
pub mount_ns: Option<String>,
}Expand description
The OS-level facts of a running container/process on the box.
Plain descriptor. cgroup/mount_ns are opaque path handles filled in
once cgroup/mount modules do real resolution; unset here.
Fields§
§container_id: Stringdockerd container id (or a PID-derived id for a bare process).
uid: u32The uid the container/process runs as on the host.
cgroup: Option<String>Resolved cgroup path, if known.
mount_ns: Option<String>Resolved mount-namespace handle (e.g. /proc/<pid>/ns/mnt), if
known.
Implementations§
Source§impl ContainerRef
impl ContainerRef
Sourcepub fn new(container_id: impl Into<String>, uid: u32) -> Self
pub fn new(container_id: impl Into<String>, uid: u32) -> Self
A bare container reference: just the id and the uid it runs as.
Sourcepub fn with_cgroup(self, cgroup: impl Into<String>) -> Self
pub fn with_cgroup(self, cgroup: impl Into<String>) -> Self
Attach a resolved cgroup path.
Sourcepub fn with_mount_ns(self, mount_ns: impl Into<String>) -> Self
pub fn with_mount_ns(self, mount_ns: impl Into<String>) -> Self
Attach a resolved mount-namespace handle.
Trait Implementations§
Source§impl Clone for ContainerRef
impl Clone for ContainerRef
Source§impl Debug for ContainerRef
impl Debug for ContainerRef
impl Eq for ContainerRef
Source§impl PartialEq for ContainerRef
impl PartialEq for ContainerRef
impl StructuralPartialEq for ContainerRef
Auto Trait Implementations§
impl Forget for ContainerRef
impl Freeze for ContainerRef
impl Move for ContainerRef
impl RefUnwindSafe for ContainerRef
impl Send for ContainerRef
impl Sync for ContainerRef
impl Unpin for ContainerRef
impl UnsafeUnpin for ContainerRef
impl UnwindSafe for ContainerRef
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