Function sink
pub fn sink() -> Sink
Available on crate feature
io-util only.Creates an instance of an async writer which will successfully consume all data.
All calls to poll_write on the returned instance will return Poll::Ready(Ok(buf.len())) and the contents of the buffer will not be inspected.
This is an asynchronous version of std::io::sink.
Examples
use tokio::io::{self, AsyncWriteExt};
let buffer = vec![1, 2, 3, 5, 8];
let num_bytes = io::sink().write(&buffer).await?;
assert_eq!(num_bytes, 5);
Ok(())
MIT License
Copyright © Tokio Contributors
https://docs.rs/tokio/1.53.1/tokio/io/fn.sink.html