Struct Sink

Source
pub struct Sink;
Expand description

A sink to which all writes succeed. See [std::io::Sink] for more info.

Created using io::sink().

Trait Implementations§

Source§

impl Write for Sink

Source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Writes buf into this writer, returning how many bytes were written.
Source§

fn write_all(&mut self, _: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer.
Source§

fn flush(&mut self) -> Result<(), Error>

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination.

Auto Trait Implementations§

§

impl Freeze for Sink

§

impl RefUnwindSafe for Sink

§

impl Send for Sink

§

impl Sync for Sink

§

impl Unpin for Sink

§

impl UnwindSafe for Sink

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<W> WriteExt for W
where W: Write + ?Sized,

Source§

fn emit_u64(&mut self, v: u64) -> Result<(), Error>

Outputs a 64-bit unsigned integer.
Source§

fn emit_u32(&mut self, v: u32) -> Result<(), Error>

Outputs a 32-bit unsigned integer.
Source§

fn emit_u16(&mut self, v: u16) -> Result<(), Error>

Outputs a 16-bit unsigned integer.
Source§

fn emit_i64(&mut self, v: i64) -> Result<(), Error>

Outputs a 64-bit signed integer.
Source§

fn emit_i32(&mut self, v: i32) -> Result<(), Error>

Outputs a 32-bit signed integer.
Source§

fn emit_i16(&mut self, v: i16) -> Result<(), Error>

Outputs a 16-bit signed integer.
Source§

fn emit_i8(&mut self, v: i8) -> Result<(), Error>

Outputs an 8-bit signed integer.
Source§

fn emit_u8(&mut self, v: u8) -> Result<(), Error>

Outputs an 8-bit unsigned integer.
Source§

fn emit_bool(&mut self, v: bool) -> Result<(), Error>

Outputs a boolean.
Source§

fn emit_slice(&mut self, v: &[u8]) -> Result<(), Error>

Outputs a byte slice.
Source§

impl<W> Writer for W
where W: Write,

Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Writes the given buf out. See std::io::Write::write_all for more