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§
Sourcefn peekable(self) -> AsyncPeekable<Self>where
Self: Sized,
fn peekable(self) -> AsyncPeekable<Self>where
Self: Sized,
Creates a new AsyncPeekable which will wrap the given reader.
Sourcefn peekable_with_capacity(self, capacity: usize) -> AsyncPeekable<Self>where
Self: Sized,
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.
Sourcefn peekable_with_buffer<B>(self) -> AsyncPeekable<Self, B>
fn peekable_with_buffer<B>(self) -> AsyncPeekable<Self, B>
Creates a new AsyncPeekable which will wrap the given reader.
This method allows you to specify a custom buffer type.
Sourcefn peekable_with_capacity_and_buffer<B>(
self,
capacity: usize,
) -> AsyncPeekable<Self, B>
fn peekable_with_capacity_and_buffer<B>( self, capacity: usize, ) -> AsyncPeekable<Self, B>
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.