Struct libmount::BindMount [−][src]
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]
impl BindMount
pub fn new<A: AsRef<Path>, B: AsRef<Path>>(source: A, target: B) -> BindMount
[src]
pub fn new<A: AsRef<Path>, B: AsRef<Path>>(source: A, target: B) -> BindMount
Create a new, recursive bind mount
You can disable recursion with a non_recursive()
method
pub fn recursive(self, flag: bool) -> BindMount
[src]
pub fn recursive(self, flag: bool) -> BindMount
Toggle recursion
pub fn readonly(self, flag: bool) -> BindMount
[src]
pub fn readonly(self, flag: bool) -> BindMount
If set to true
makes bind-mount readonly
Few notes:
- This makes additional
mount
call (Remount().readonly()
) - If remount fails mount bind is left on the filesystem, no cleanup is done
- If set to
false
is option is no-op (does not remountrw
)
pub fn bare_mount(self) -> Result<(), OSError>
[src]
pub fn bare_mount(self) -> Result<(), OSError>
Execute a bind mount
pub fn mount(self) -> Result<(), Error>
[src]
pub fn mount(self) -> Result<(), Error>
Execute a bind mount and explain the error immediately
Trait Implementations
impl Debug for BindMount
[src]
impl Debug for BindMount
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for BindMount
[src]
impl Clone for BindMount
fn clone(&self) -> BindMount
[src]
fn clone(&self) -> BindMount
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Display for BindMount
[src]
impl Display for BindMount