Skip to main content

ReadAtShim

Struct ReadAtShim 

Source
pub struct ReadAtShim<S>(pub S);
Expand description

Shim presenting a concrete ReadAt as a DynReadAt.

Tuple Fields§

§0: S

Trait Implementations§

Source§

impl<S: ReadAt> DynReadAt for ReadAtShim<S>

Source§

fn len(&mut self) -> Result<u64, BoxedError>

Total length in bytes (may be expensive; see ReadAt::len).
Source§

fn read_exact_at( &mut self, offset: u64, out: &mut [u8], ) -> Result<(), BoxedError>

Fill out with the bytes at offset.
Source§

fn read_many_at( &mut self, reqs: &mut [(u64, &mut [u8])], ) -> Result<(), BoxedError>

Fill each buffer from its offset, concurrently where possible.
Source§

fn len_hint(&self) -> Option<u64>

Total length if known without reading ahead.
Source§

fn read_at(&mut self, offset: u64, out: &mut [u8]) -> Result<usize, BoxedError>

Read up to out.len() bytes at offset; see ReadAt::read_at.
Source§

fn as_slice(&self) -> Option<&[u8]>

The whole source as one slice, when already in memory.
Source§

fn is_empty(&mut self) -> Result<bool, BoxedError>

Whether the source holds no bytes.

Auto Trait Implementations§

§

impl<S> Freeze for ReadAtShim<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for ReadAtShim<S>
where S: RefUnwindSafe,

§

impl<S> Send for ReadAtShim<S>
where S: Send,

§

impl<S> Sync for ReadAtShim<S>
where S: Sync,

§

impl<S> Unpin for ReadAtShim<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for ReadAtShim<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for ReadAtShim<S>
where S: 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 = 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.