anybytes 0.20.2

A small library abstracting over bytes owning types in an extensible way.
Documentation
1
2
3
4
5
6
7
use anybytes::Bytes;

fn main() {
    let bytes = Bytes::from(vec![1u8, 2, 3]);
    let original = bytes.try_unwrap_owner::<Vec<u8>>().expect("unique owner");
    assert_eq!(original, vec![1, 2, 3]);
}