Struct sys_mount::MountBuilder
source · [−]pub struct MountBuilder<'a> { /* private fields */ }
Expand description
Builder API for mounting devices
use sys_mount::*;
fn main() -> std::io::Result<()> {
let _mount = Mount::builder()
.fstype("btrfs")
.data("subvol=@home")
.mount("/dev/sda1", "/home")?;
Ok(())
}
Implementations
sourceimpl<'a> MountBuilder<'a>
impl<'a> MountBuilder<'a>
sourcepub fn fstype(self, fs: impl Into<FilesystemType<'a>>) -> Self
pub fn fstype(self, fs: impl Into<FilesystemType<'a>>) -> Self
The file system that is to be mounted.
sourcepub fn flags(self, flags: MountFlags) -> Self
pub fn flags(self, flags: MountFlags) -> Self
Mount flags for the mount syscall.
sourcepub fn mount(
self,
source: impl AsRef<Path>,
target: impl AsRef<Path>
) -> Result<Mount>
pub fn mount(
self,
source: impl AsRef<Path>,
target: impl AsRef<Path>
) -> Result<Mount>
Mount the source
to the target
.
sourcepub fn mount_autodrop(
self,
source: impl AsRef<Path>,
target: impl AsRef<Path>,
unmount_flags: UnmountFlags
) -> Result<UnmountDrop<Mount>>
pub fn mount_autodrop(
self,
source: impl AsRef<Path>,
target: impl AsRef<Path>,
unmount_flags: UnmountFlags
) -> Result<UnmountDrop<Mount>>
Perform a mount which auto-unmounts on drop.
Trait Implementations
sourceimpl<'a> Default for MountBuilder<'a>
impl<'a> Default for MountBuilder<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for MountBuilder<'a>
impl<'a> Send for MountBuilder<'a>
impl<'a> Sync for MountBuilder<'a>
impl<'a> Unpin for MountBuilder<'a>
impl<'a> UnwindSafe for MountBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more