pub struct BindMount { /* private fields */ }Expand description
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.
Implementations§
Source§impl BindMount
impl BindMount
Sourcepub fn new<A: AsRef<Path>, B: AsRef<Path>>(source: A, target: B) -> BindMount
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
Sourcepub fn readonly(self, flag: bool) -> BindMount
pub fn readonly(self, flag: bool) -> BindMount
If set to true makes bind-mount readonly
Few notes:
- This makes additional
mountcall (Remount().readonly()) - If remount fails mount bind is left on the filesystem, no cleanup is done
- If set to
falseis option is no-op (does not remountrw)
Sourcepub fn bare_mount(self) -> Result<(), OSError>
pub fn bare_mount(self) -> Result<(), OSError>
Execute a bind mount
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BindMount
impl RefUnwindSafe for BindMount
impl Send for BindMount
impl Sync for BindMount
impl Unpin for BindMount
impl UnwindSafe for BindMount
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more