wsdf 0.1.2

Proc-macro based Wireshark Dissector Framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#[derive(wsdf::Dispatch)]
pub enum Foo {
    Bar,
    Baz(usize),
    Qux { eggs: u64 },
}

fn main() {
    assert_eq!(FooDispatch::Bar as usize, 0);
    assert_eq!(FooDispatch::Baz as usize, 1);
    assert_eq!(FooDispatch::Qux as usize, 2);
}