Struct Writer
struct Writer<B> { ... }
A BufMut adapter which implements io::Write for the inner value.
This struct is generally created by calling writer() on BufMut. See
documentation of writer() for more
details.
Implementations
impl<B: BufMut> Writer<B>
fn get_ref(self: &Self) -> &BGets a reference to the underlying
BufMut.It is inadvisable to directly write to the underlying
BufMut.Examples
use BufMut; let buf = Vecwith_capacity.writer; assert_eq!;fn get_mut(self: &mut Self) -> &mut BGets a mutable reference to the underlying
BufMut.It is inadvisable to directly write to the underlying
BufMut.Examples
use BufMut; let mut buf = vec!.writer; buf.get_mut.reserve; assert_eq!;fn into_inner(self: Self) -> BConsumes this
Writer, returning the underlying value.Examples
use BufMut; use io; let mut buf = vec!.writer; let mut src = &b"hello world"; copy.unwrap; let buf = buf.into_inner; assert_eq!;
impl<B> Freeze for Writer<B>
impl<B> RefUnwindSafe for Writer<B>
impl<B> Send for Writer<B>
impl<B> Sync for Writer<B>
impl<B> Unpin for Writer<B>
impl<B> UnsafeUnpin for Writer<B>
impl<B> UnwindSafe for Writer<B>
impl<B: $crate::fmt::Debug> Debug for Writer<B>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<B: BufMut + Sized> Write for Writer<B>
fn write(self: &mut Self, src: &[u8]) -> Result<usize>fn flush(self: &mut Self) -> Result<()>
impl<T> Any for Writer<B>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Writer<B>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Writer<B>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Writer<B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Writer<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 Writer<B>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Writer<B>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>