pub struct Sink;
Expand description
Silently drops everything that is written to it.
Trait Implementations§
Source§impl Write for Sink
impl Write for Sink
Source§type WriteError = Void
type WriteError = Void
Value of this type is returned when
write()
fails. Read moreSource§type FlushError = Void
type FlushError = Void
Value of this type is returned when
flush()
fails.
In case of low-level writers flush often does nothing and therefore doesn’t return error,
so this type might be Void. Read moreSource§fn write(&mut self, buf: &[u8]) -> Result<usize, <Sink as Write>::WriteError>
fn write(&mut self, buf: &[u8]) -> Result<usize, <Sink as Write>::WriteError>
Write a buffer into this object, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), <Sink as Write>::FlushError>
fn flush(&mut self) -> Result<(), <Sink as Write>::FlushError>
Flush this output stream, ensuring that all intermediately buffered contents reach their
destination. Read more
Source§fn size_hint(&mut self, _bytes: usize)
fn size_hint(&mut self, _bytes: usize)
Hints the writer how much bytes will be written after call to this function.
If the maximum amount of bytes to be written is known then it should be passed as argument.
If the maximum amount is unknown, then minimum should be passed. Read more
Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::WriteError>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::WriteError>
Attempts to write an entire buffer into this
Write
.Source§fn uses_size_hint(&self) -> bool
fn uses_size_hint(&self) -> bool
Reports to the caller whether size hint is actually used. This can prevent costly
computation of size hint that would be thrown away.
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> 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