Implementation of std::io::Write
which calculates how much data was written into it.
Add the following to your Cargo.toml
:
toml
[dependencies]
written_size = "0.1"
Api documentation can be found here.
```rust use std::io::Write; use written_size::WrittenSize;
let mut ws = WrittenSize::new(); ws.write(&[1, 2, 3]).unwrap(); ws.write(&[1, 2, 3]).unwrap();
assert!(ws.size() == 6); ```