match_bytes

Crates.iomatch_bytes
lib.rsmatch_bytes
version0.1.0
sourcesrc
created_at2022-12-31 21:46:55.887798
updated_at2022-12-31 21:46:55.887798
descriptionA language extension for matching byte patterns in slices of bytes
homepage
repository
max_upload_size
id748590
size167,077
Mason Fischer (masonforest)

documentation

README

matches_bytes

matches_bytes is a library for matching byte patterns in slices of bytes. matches_bytes is inspired by Erlang's bit sytax.

Example

    let bytes = [0, 0, 0, 1, 0, 0, 0, 0];
    match_bytes!([prefix: u32 / be, rest @ ..] = &bytes);

    assert_eq!(prefix, 1);
    assert_eq!(*rest, [0, 0, 0, 0]);
Commit count: 0

cargo fmt