Struct Reader
struct Reader<B> { ... }
A Buf adapter which implements io::Read for the inner value.
This struct is generally created by calling reader() on Buf. See
documentation of reader() for more
details.
Implementations
impl<B: Buf> Reader<B>
fn get_ref(self: &Self) -> &BGets a reference to the underlying
Buf.It is inadvisable to directly read from the underlying
Buf.Examples
use Buf; let buf = b"hello world".reader; assert_eq!;fn get_mut(self: &mut Self) -> &mut BGets a mutable reference to the underlying
Buf.It is inadvisable to directly read from the underlying
Buf.fn into_inner(self: Self) -> BConsumes this
Reader, returning the underlying value.Examples
use Buf; use io; let mut buf = b"hello world".reader; let mut dst = vec!; copy.unwrap; let buf = buf.into_inner; assert_eq!;
impl<B> Freeze for Reader<B>
impl<B> RefUnwindSafe for Reader<B>
impl<B> Send for Reader<B>
impl<B> Sync for Reader<B>
impl<B> Unpin for Reader<B>
impl<B> UnsafeUnpin for Reader<B>
impl<B> UnwindSafe for Reader<B>
impl<B: $crate::fmt::Debug> Debug for Reader<B>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<B: Buf + Sized> BufRead for Reader<B>
fn fill_buf(self: &mut Self) -> Result<&[u8]>fn consume(self: &mut Self, amt: usize)
impl<B: Buf + Sized> Read for Reader<B>
fn read(self: &mut Self, dst: &mut [u8]) -> Result<usize>
impl<T> Any for Reader<B>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Reader<B>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Reader<B>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Reader<B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Reader<B>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Reader<B>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Reader<B>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>