RawIo

Struct RawIo 

Source
pub struct RawIo { /* private fields */ }
Expand description

Raw device I/O for Linux OS.

Trait Implementations§

Source§

impl Drop for RawIoLinux

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl RawIoOsIntf for RawIoLinux

Source§

fn new(path: &Path, create: bool, read: bool, write: bool) -> Result<Self>

Open a file or device.
Source§

fn get_sector_size(&self) -> Option<u32>

Get the physical sector size of the file or device. Returns None, if this is not a raw device.
Source§

fn drop_file_caches(&mut self, offset: u64, size: u64) -> Result<()>

Close the file, flush all buffers and drop all caches. This function ensures that subsequent reads are not read from RAM cache.
Source§

fn close(&mut self) -> Result<()>

Close the file and flush all buffers. (This does not affect the caches).
Source§

fn sync(&mut self) -> Result<()>

Flush all buffers. (This does not affect the caches).
Source§

fn set_len(&mut self, size: u64) -> Result<()>

Truncate or extend the file length to the given size. This method is for unit testing only.
Source§

fn seek(&mut self, offset: u64) -> Result<u64>

Seek to a file offset.
Source§

fn read(&mut self, buffer: &mut [u8]) -> Result<RawIoResult>

Read a chunk of data.
Source§

fn write(&mut self, buffer: &[u8]) -> Result<RawIoResult>

Write a chunk of data.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.