[][src]Struct libmount::BindMount

pub struct BindMount { /* fields omitted */ }

A mount bind definition

By default bind mount is recursive (it's what you want most of the time).

Also recursive mounts can be used in user namespaces.

Methods

impl BindMount[src]

pub fn new<A: AsRef<Path>, B: AsRef<Path>>(source: A, target: B) -> BindMount[src]

Create a new, recursive bind mount

You can disable recursion with a non_recursive() method

pub fn recursive(self, flag: bool) -> BindMount[src]

Toggle recursion

pub fn readonly(self, flag: bool) -> BindMount[src]

If set to true makes bind-mount readonly

Few notes:

  1. This makes additional mount call (Remount().readonly())
  2. If remount fails mount bind is left on the filesystem, no cleanup is done
  3. If set to false is option is no-op (does not remount rw)

pub fn bare_mount(self) -> Result<(), OSError>[src]

Execute a bind mount

pub fn mount(self) -> Result<(), Error>[src]

Execute a bind mount and explain the error immediately

Trait Implementations

impl Clone for BindMount[src]

impl Display for BindMount[src]

impl Debug for BindMount[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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

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

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