pub struct OwnedRwSlice { /* private fields */ }Expand description
Owned, read-WRITE slice over an Arc<dyn BlockDevice>. Use when the
parent is writable and the slice should propagate writes (e.g. an
individual partition handed to a filesystem driver).
Reads outside [0, length) return Error::ShortRead with got: 0;
writes outside it return Error::OutOfBounds. The two directions
differ on purpose — see the module docs.
Implementations§
Trait Implementations§
Source§impl BlockDevice for OwnedRwSlice
impl BlockDevice for OwnedRwSlice
Source§fn write_at(&self, offset: u64, buf: &[u8]) -> Result<()>
fn write_at(&self, offset: u64, buf: &[u8]) -> Result<()>
Range first, writability second: a write that is both out of range
and aimed at a read-only parent reports Error::OutOfBounds,
not Error::ReadOnly. The range is a property of this slice and
is knowable without asking the parent anything, so it is the more
specific of the two answers.
Source§fn is_writable(&self) -> bool
fn is_writable(&self) -> bool
Whether
write_at is likely to succeed. Mount paths use this to
decide whether to attempt journal replay or stay strict-read-only.Auto Trait Implementations§
impl !RefUnwindSafe for OwnedRwSlice
impl !UnwindSafe for OwnedRwSlice
impl Freeze for OwnedRwSlice
impl Send for OwnedRwSlice
impl Sync for OwnedRwSlice
impl Unpin for OwnedRwSlice
impl UnsafeUnpin for OwnedRwSlice
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