Skip to main content

ReadOp

Struct ReadOp 

Source
pub struct ReadOp<'a, H>
where H: FileHandle + 'a,
{ /* private fields */ }
Expand description

One consuming read operation. Construction performs no I/O or allocation. Caller buffers are borrowed only until Vfsi::vread returns, including on errors.

Implementations§

Source§

impl<'a, H> ReadOp<'a, H>
where H: FileHandle + 'a,

Source

pub fn whole<P>(path: &'a P) -> ReadOp<'a, H>
where P: AsRef<Path> + ?Sized,

Collect a complete file; fail instead of truncating at the byte budget.

Source

pub fn range(file: &'a H, offset: u64, length: usize) -> ReadOp<'a, H>

Allocate a positional range. Short progress and EOF are reported explicitly.

Source

pub fn into(file: &'a H, offset: u64, buffer: &'a mut [u8]) -> ReadOp<'a, H>

Fill caller storage at an absolute offset, without changing the cursor. The request length is exactly buffer.len().

Source

pub fn whole_file_path(&self) -> Option<&'a Path>

Inspect a complete-file path from an external Vfsi implementation.

Source

pub fn range_ref(&self) -> Option<&<H as FileHandle>::ReadRequest<'a>>

Borrow an allocating range request from an external implementation.

Source

pub fn buffer_request_mut( &mut self, ) -> Option<&mut <H as FileHandle>::ReadIntoRequest<'a>>

Borrow a caller-buffer request exclusively from an external implementation.

Trait Implementations§

Source§

impl<H> Debug for ReadOp<'_, H>
where H: FileHandle,

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, H> From<&'a Path> for ReadOp<'a, H>
where H: FileHandle + 'a,

Source§

fn from(path: &'a Path) -> ReadOp<'a, H>

Converts to this type from the input type.
Source§

impl<'a, H> From<&'a str> for ReadOp<'a, H>
where H: FileHandle + 'a,

Source§

fn from(path: &'a str) -> ReadOp<'a, H>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, H> Freeze for ReadOp<'a, H>
where OpSource<'a, H>: Freeze,

§

impl<'a, H> RefUnwindSafe for ReadOp<'a, H>
where OpSource<'a, H>: RefUnwindSafe,

§

impl<'a, H> Send for ReadOp<'a, H>
where OpSource<'a, H>: Send,

§

impl<'a, H> Sync for ReadOp<'a, H>
where OpSource<'a, H>: Sync,

§

impl<'a, H> Unpin for ReadOp<'a, H>
where OpSource<'a, H>: Unpin,

§

impl<'a, H> UnsafeUnpin for ReadOp<'a, H>
where OpSource<'a, H>: UnsafeUnpin,

§

impl<'a, H> UnwindSafe for ReadOp<'a, H>
where OpSource<'a, H>: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.