Struct Writer
pub struct Writer<B> { /* private fields */ }
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) -> &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(&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) -> 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!;
Trait Implementations
impl<B: BufMut + Sized> Write for Writer<B>
fn write(&mut self, src: &[u8]) -> Result<usize>fn flush(&mut self) -> Result<()>
impl<B: Debug> Debug for Writer<B>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<B> Freeze for Writer<B>
where
B: Freeze,
impl<B> RefUnwindSafe for Writer<B>
where
B: RefUnwindSafe,
impl<B> Send for Writer<B>
where
B: Send,
impl<B> Sync for Writer<B>
where
B: Sync,
impl<B> Unpin for Writer<B>
where
B: Unpin,
impl<B> UnsafeUnpin for Writer<B>
where
B: UnsafeUnpin,
impl<B> UnwindSafe for Writer<B>
where
B: UnwindSafe,
Blanket Implementations
impl<T> Any for Writer<B>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Writer<B>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Writer<B>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Writer<B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for Writer<B>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Writer<B>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Writer<B>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>