[][src]Struct beach::Chroot

pub struct Chroot { /* fields omitted */ }

A wrapper for chroot(1).

Note: Running chroot requires root privileges.

Examples

beach::Chroot::new()
    .user_group("nvzqz", "everyone")
    .command("/path/to/root", "ls")
    .arg("/")
    .spawn();

Methods

impl Chroot[src]

pub const fn new() -> Self[src]

Creates an instance suitable for setting up a Command to execute a program through chroot.

pub fn skip_chdir(self) -> Self[src]

Do not change the working directory to /.

pub fn user<U>(self, user: U) -> Self where
    U: AsRef<OsStr>, 
[src]

Specify the user to use.

pub fn user_group<U, G>(self, user: U, group: G) -> Self where
    U: AsRef<OsStr>,
    G: AsRef<OsStr>, 
[src]

Specify the user and group (ID or name) to use.

pub fn groups<G>(self, groups: G) -> Self where
    G: IntoIterator,
    G::Item: AsRef<OsStr>, 
[src]

Specifies supplementary groups.

pub fn command<R, P>(&self, root: R, program: P) -> Command where
    R: AsRef<Path>,
    P: AsRef<OsStr>, 
[src]

Returns a Command suitable for spawning program with root as /.

Trait Implementations

impl Clone for Chroot[src]

impl Debug for Chroot[src]

impl Default for Chroot[src]

Auto Trait Implementations

impl RefUnwindSafe for Chroot

impl Send for Chroot

impl Sync for Chroot

impl Unpin for Chroot

impl UnwindSafe for Chroot

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.