pub struct LoopDevice { /* private fields */ }
Expand description
Interface to a loop device itself, e.g. /dev/loop0
.
Implementations§
Source§impl LoopDevice
impl LoopDevice
Sourcepub fn open<P: AsRef<Path>>(dev: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(dev: P) -> Result<Self>
Opens a loop device.
§Errors
Any errors from opening the underlying physical loop device are bubbled up.
Sourcepub fn with(&self) -> AttachOptions<'_>
pub fn with(&self) -> AttachOptions<'_>
Attach a loop device to a file with the given options.
Sourcepub fn set_direct_io(&self, direct_io: bool) -> Result<()>
pub fn set_direct_io(&self, direct_io: bool) -> Result<()>
Enables or disables Direct I/O mode.
Sourcepub fn attach_file<P: AsRef<Path>>(&self, backing_file: P) -> Result<()>
pub fn attach_file<P: AsRef<Path>>(&self, backing_file: P) -> Result<()>
Attach the loop device to a fully-mapped file.
Sourcepub fn set_capacity(&self) -> Result<()>
pub fn set_capacity(&self) -> Result<()>
Update a loop device’s capacity.
Trait Implementations§
Source§impl AsRawFd for LoopDevice
impl AsRawFd for LoopDevice
Source§impl Debug for LoopDevice
impl Debug for LoopDevice
Source§impl IntoRawFd for LoopDevice
impl IntoRawFd for LoopDevice
Source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations§
impl Freeze for LoopDevice
impl RefUnwindSafe for LoopDevice
impl Send for LoopDevice
impl Sync for LoopDevice
impl Unpin for LoopDevice
impl UnwindSafe for LoopDevice
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