Trait AsyncMapRead

Source
pub trait AsyncMapRead<'a, R> {
    // Required method
    fn map_with_capacity(
        self,
        f: impl MapReadFn + 'a,
        capacity: usize,
    ) -> AsyncMapReader<'a, R>;

    // Provided method
    fn map(self, f: impl MapReadFn + 'a) -> AsyncMapReader<'a, R>
       where Self: Sized { ... }
}
Expand description

A trait for types that can be mapped to an AsyncMapReader.

Required Methods§

Source

fn map_with_capacity( self, f: impl MapReadFn + 'a, capacity: usize, ) -> AsyncMapReader<'a, R>

Maps the underlying reader to an AsyncMapReader using the provided mapping function and a specified buffer capacity.

This function allows for more control over the internal buffer size, which can be useful for performance tuning.

Provided Methods§

Source

fn map(self, f: impl MapReadFn + 'a) -> AsyncMapReader<'a, R>
where Self: Sized,

Maps the underlying reader to an AsyncMapReader using the provided mapping function. This function uses a default buffer size (8KB) for the internal buffer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, R: AsyncRead> AsyncMapRead<'a, R> for R