Trait DynRead

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

Dyn compatible(object safety) version of Read. Same as DynWrite.

Required Methods§

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl<'read> Read for Box<dyn DynRead + 'read>

Source§

type Error = Error

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,