pub struct AxDisk { /* private fields */ }
Available on crate features
fs
and myfs
only.Expand description
A disk device with a cursor.
Implementations§
Source§impl Disk
impl Disk
Sourcepub fn set_position(&mut self, pos: u64)
pub fn set_position(&mut self, pos: u64)
Set the position of the cursor.
Sourcepub fn read_one(&mut self, buf: &mut [u8]) -> Result<usize, DevError>
pub fn read_one(&mut self, buf: &mut [u8]) -> Result<usize, DevError>
Read within one block, returns the number of bytes read.
Sourcepub fn write_one(&mut self, buf: &[u8]) -> Result<usize, DevError>
pub fn write_one(&mut self, buf: &[u8]) -> Result<usize, DevError>
Write within one block, returns the number of bytes written.
Sourcepub fn read_offset(&mut self, offset: usize) -> [u8; 512]
pub fn read_offset(&mut self, offset: usize) -> [u8; 512]
Read a single block starting from the specified offset.
Auto Trait Implementations§
impl Freeze for Disk
impl RefUnwindSafe for Disk
impl Send for Disk
impl Sync for Disk
impl Unpin for Disk
impl UnwindSafe for Disk
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