pub struct BufReader<T> { /* private fields */ }Expand description
Wraps an AsyncRead with an internal buffer, amortizing many small
.read() calls into fewer, larger reads on the underlying stream.
Implementations§
Source§impl<T> BufReader<T>
impl<T> BufReader<T>
Sourcepub fn with_capacity(capacity: usize, inner: T) -> Self
pub fn with_capacity(capacity: usize, inner: T) -> Self
Wrap inner with a capacity-byte internal buffer.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwrap back to the underlying stream. Any bytes already buffered
but not yet consumed via Self::read are discarded.
Auto Trait Implementations§
impl<T> Freeze for BufReader<T>where
T: Freeze,
impl<T> RefUnwindSafe for BufReader<T>where
T: RefUnwindSafe,
impl<T> Send for BufReader<T>where
T: Send,
impl<T> Sync for BufReader<T>where
T: Sync,
impl<T> Unpin for BufReader<T>where
T: Unpin,
impl<T> UnsafeUnpin for BufReader<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for BufReader<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more