Trait DynRead

Source
pub unsafe trait DynRead:
    MaybeSend
    + MaybeSync
    + Sealed {
    // Required methods
    fn read_exact_at(
        &mut self,
        buf: BufMut,
        pos: u64,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = (Result<(), Error>, BufMut)> + '_>>;
    fn read_to_end_at(
        &mut self,
        buf: Vec<u8>,
        pos: u64,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = (Result<(), Error>, Vec<u8>)> + '_>>;
    fn size(
        &self,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<u64, Error>> + '_>>;
}
Available on crate feature alloc only.
Expand description

Dyn compatible (object safe) version of Read.

Similar to DynWrite, all implementations of Read automatically implement this trait. Users should not use this trait directly.

§Safety

Do not implement this trait directly. All implementations of Read automatically implement this trait.

Required Methods§

Source

fn read_exact_at( &mut self, buf: BufMut, pos: u64, ) -> Pin<Box<dyn MaybeSendFuture<Output = (Result<(), Error>, BufMut)> + '_>>

Source

fn read_to_end_at( &mut self, buf: Vec<u8>, pos: u64, ) -> Pin<Box<dyn MaybeSendFuture<Output = (Result<(), Error>, Vec<u8>)> + '_>>

Source

fn size( &self, ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<u64, Error>> + '_>>

Trait Implementations§

Source§

impl Read for Box<dyn DynRead + '_>

Source§

async fn read_exact_at<B: IoBufMut>( &mut self, buf: B, pos: u64, ) -> (Result<(), Error>, B)

Source§

async fn read_to_end_at( &mut self, buf: Vec<u8>, pos: u64, ) -> (Result<(), Error>, Vec<u8>)

Source§

async fn size(&self) -> Result<u64, Error>

Implementors§

Source§

impl<R> DynRead for R
where R: Read,