musli-zerocopy 0.0.138

Refreshingly simple zero copy primitives by Müsli.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use musli_zerocopy::{Error, OwnedBuf};

fn main() -> Result<(), Error> {
    let mut buf = OwnedBuf::new();

    let first = buf.store_unsized("first");
    let second = buf.store_unsized("second");

    let buf = buf.as_ref();

    assert_eq!(buf.load(first)?, "first");
    assert_eq!(buf.load(second)?, "second");
    Ok(())
}