mod netns;
pub use self::netns::*;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Can not create netns directory, {0}")]
CreateNsDirError(std::io::Error),
#[error("Can not create netns,{0}")]
CreateNsError(std::io::Error),
#[error("Can not open netns {0},{1}")]
OpenNsError(std::path::PathBuf, std::io::Error),
#[error("Failed to close netns,{0}")]
CloseNsError(nix::Error),
#[error("Failed to mount {0}, {1}")]
MountError(String, nix::Error),
#[error("Failed to unmount {0}, {1}")]
UnmountError(std::path::PathBuf, nix::Error),
#[error("Failed to unshare, {0}")]
UnshareError(nix::Error),
#[error("Failed to join thread, {0}")]
JoinThreadError(String),
#[error("Can not setns, {0}")]
SetnsError(nix::Error),
}