Function eos_rs::api::io::sink

source ·
pub const fn sink() -> Sink
Expand description

Creates an instance of a writer which will successfully consume all data.

All calls to write on the returned instance will return Ok(buf.len()) and the contents of the buffer will not be inspected.

Examples

use acid_io::Write;

let buffer = vec![1, 2, 3, 5, 8];
let num_bytes = acid_io::sink().write(&buffer).unwrap();
assert_eq!(num_bytes, 5);