[−][src]Struct rtnetlink::NetworkNamespace
Implementations
impl NetworkNamespace
[src]
pub async fn add(ns_name: String) -> Result<(), Error>
[src]
Add a new network namespace.
This is equivalent to ip netns add NS_NAME
.
pub async fn del(ns_name: String) -> Result<(), Error>
[src]
Remove a network namespace
This is equivalent to ip netns del NS_NAME
.
pub fn prep_for_fork() -> Result<(), Error>
[src]
pub fn parent_process(child: Pid) -> Result<(), Error>
[src]
This is the parent process form the fork, it waits for the child to exit properly
pub fn child_process(ns_name: String) -> Result<String, Error>
[src]
This is the child process, it will actually create the namespace resources. It creates the folder and namespace file. Returns the namespace file path
pub fn unshare_processing(netns_path: String) -> Result<(), Error>
[src]
This function unshare the calling process and move into the given network namespace
Auto Trait Implementations
impl RefUnwindSafe for NetworkNamespace
[src]
impl Send for NetworkNamespace
[src]
impl Sync for NetworkNamespace
[src]
impl Unpin for NetworkNamespace
[src]
impl UnwindSafe for NetworkNamespace
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,