pub struct NamespaceConfig {
pub pid: bool,
pub mnt: bool,
pub net: bool,
pub uts: bool,
pub ipc: bool,
pub cgroup: bool,
pub user: bool,
pub time: bool,
}Expand description
Namespace configuration
Defines which Linux namespaces to create for isolation
Fields§
§pid: boolPID namespace - process isolation
mnt: boolMount namespace - filesystem isolation
net: boolNetwork namespace - network isolation
uts: boolUTS namespace - hostname isolation
ipc: boolIPC namespace - inter-process communication isolation
cgroup: boolCgroup namespace - isolate cgroup hierarchy visibility
user: boolUser namespace - user/group ID isolation
time: boolTime namespace - isolate time offsets from the host
Implementations§
Source§impl NamespaceConfig
impl NamespaceConfig
Sourcepub fn minimal() -> Self
pub fn minimal() -> Self
Create config with minimal namespaces for isolation.
M10: UTS and IPC are enabled even in minimal mode. Without UTS, containers can change the host hostname. Without IPC, they share System V IPC objects.
Sourcepub fn with_cgroup_namespace(self, enabled: bool) -> Self
pub fn with_cgroup_namespace(self, enabled: bool) -> Self
Enable or disable cgroup namespace isolation.
Sourcepub fn with_time_namespace(self, enabled: bool) -> Self
pub fn with_time_namespace(self, enabled: bool) -> Self
Enable or disable time namespace isolation.
Trait Implementations§
Source§impl Clone for NamespaceConfig
impl Clone for NamespaceConfig
Source§fn clone(&self) -> NamespaceConfig
fn clone(&self) -> NamespaceConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NamespaceConfig
impl Debug for NamespaceConfig
Auto Trait Implementations§
impl Freeze for NamespaceConfig
impl RefUnwindSafe for NamespaceConfig
impl Send for NamespaceConfig
impl Sync for NamespaceConfig
impl Unpin for NamespaceConfig
impl UnsafeUnpin for NamespaceConfig
impl UnwindSafe for NamespaceConfig
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