[−][src]Struct jail::StoppedJail
Represent a stopped jail including all information required to start it
Fields
path: Option<PathBuf>
The path of root file system of the jail
name: Option<String>
The jail name
hostname: Option<String>
The jail hostname
params: HashMap<String, Value>
A hashmap of jail parameters and their values
ips: Vec<IpAddr>
A list of IP (v4 and v6) addresses to be assigned to this jail
limits: Vec<(Resource, Limit, Action)>
A list of resource limits
Implementations
impl StoppedJail
[src]
pub fn new<P: Into<PathBuf> + Debug>(path: P) -> StoppedJail
[src]
Create a new Jail instance given a path.
Examples
use jail::StoppedJail; let j = StoppedJail::new("/rescue");
pub fn start(self: StoppedJail) -> Result<RunningJail, JailError>
[src]
Start the jail
This will call jail_create internally. This will consume the StoppedJail and return a Result<RunningJail,Error>.
Examples
use jail::StoppedJail; let stopped = StoppedJail::new("/rescue"); let running = stopped.start().unwrap();
pub fn name<S: Into<String> + Debug>(self, name: S) -> Self
[src]
Set the jail name
Examples
let mut stopped = StoppedJail::new("/rescue") .name("test_stopped_name"); assert_eq!(stopped.name, Some("test_stopped_name".to_string()));
pub fn hostname<S: Into<String> + Debug>(self, hostname: S) -> Self
[src]
Set the jail name
Examples
let mut stopped = StoppedJail::new("/rescue") .hostname("example.com"); assert_eq!(stopped.hostname, Some("example.com".to_string()));
pub fn param<S: Into<String> + Debug>(self, param: S, value: Value) -> Self
[src]
Set a jail parameter
Examples
use jail::param; let mut stopped = StoppedJail::new("/rescue") .param("allow.raw_sockets", param::Value::Int(1));
pub fn limit(self, resource: Resource, limit: Limit, action: Action) -> Self
[src]
Set a resource limit
Examples
extern crate rctl; use rctl; let mut stopped = StoppedJail::new("/rescue").limit( rctl::Resource::MemoryUse, rctl::Limit::amount_per(100 * 1024 * 1024, rctl::SubjectType::Process), rctl::Action::Deny, );
pub fn ip(self, ip: IpAddr) -> Self
[src]
Add an IP Address
Examples
let mut stopped = StoppedJail::new("rescue") .ip("127.0.1.1".parse().expect("could not parse 127.0.1.1")) .ip("fe80::2".parse().expect("could not parse ::1"));
Trait Implementations
impl Clone for StoppedJail
[src]
fn clone(&self) -> StoppedJail
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for StoppedJail
[src]
impl Default for StoppedJail
[src]
fn default() -> StoppedJail
[src]
impl Eq for StoppedJail
[src]
impl From<StoppedJail> for Jail
[src]
fn from(stopped: StoppedJail) -> Self
[src]
impl PartialEq<StoppedJail> for StoppedJail
[src]
fn eq(&self, other: &StoppedJail) -> bool
[src]
fn ne(&self, other: &StoppedJail) -> bool
[src]
impl StructuralEq for StoppedJail
[src]
impl StructuralPartialEq for StoppedJail
[src]
impl TryFrom<RunningJail> for StoppedJail
[src]
type Error = JailError
The type returned in the event of a conversion error.
fn try_from(running: RunningJail) -> Result<StoppedJail, Self::Error>
[src]
impl TryFrom<StoppedJail> for RunningJail
[src]
type Error = JailError
The type returned in the event of a conversion error.
fn try_from(stopped: StoppedJail) -> Result<RunningJail, Self::Error>
[src]
Auto Trait Implementations
impl RefUnwindSafe for StoppedJail
impl Send for StoppedJail
impl Sync for StoppedJail
impl Unpin for StoppedJail
impl UnwindSafe for StoppedJail
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,