AsyncPeekExt

Trait AsyncPeekExt 

Source
pub trait AsyncPeekExt: AsyncRead {
    // Provided methods
    fn peekable(self) -> AsyncPeekable<Self>
       where Self: Sized { ... }
    fn peekable_with_capacity(self, capacity: usize) -> AsyncPeekable<Self>
       where Self: Sized { ... }
    fn peekable_with_buffer<B>(self) -> AsyncPeekable<Self, B>
       where Self: Sized,
             B: Buffer { ... }
    fn peekable_with_capacity_and_buffer<B>(
        self,
        capacity: usize,
    ) -> AsyncPeekable<Self, B>
       where Self: Sized,
             B: Buffer { ... }
}
Available on crate feature future only.
Expand description

An extension trait which adds peek related utility methods to AsyncRead types

Provided Methods§

Source

fn peekable(self) -> AsyncPeekable<Self>
where Self: Sized,

Creates a new AsyncPeekable which will wrap the given reader.

Source

fn peekable_with_capacity(self, capacity: usize) -> AsyncPeekable<Self>
where Self: Sized,

Wraps a AsyncRead type in a AsyncPeekable which provides a peek related methods with a specified capacity.

Source

fn peekable_with_buffer<B>(self) -> AsyncPeekable<Self, B>
where Self: Sized, B: Buffer,

Creates a new AsyncPeekable which will wrap the given reader.

This method allows you to specify a custom buffer type.

Source

fn peekable_with_capacity_and_buffer<B>( self, capacity: usize, ) -> AsyncPeekable<Self, B>
where Self: Sized, B: Buffer,

Wraps a AsyncRead type in a AsyncPeekable which provides a peek related methods with a specified capacity.

This method allows you to specify a custom buffer type.

Implementors§