unshare 0.6.0

The low-level interface for linux namespaces (containers)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::ffi::{CString, OsStr};
use std::os::unix::ffi::OsStrExt;


pub trait ToCString {
    fn to_cstring(&self) -> CString;
}

impl<T:AsRef<OsStr>> ToCString for T {
    fn to_cstring(&self) -> CString {
        CString::new(self.as_ref().as_bytes())
        .unwrap()
    }
}