seedle 1.8.2

cbor codegeneration
Documentation
1
2
3
4
5
6
7
8
9
10
use minicbor::{Decode, Encode};

pub trait Cast: Encode<()> + for<'b> Decode<'b, ()> {
    fn cast(ptr: *const core::ffi::c_void) -> &'static Self;
    fn cast_mut(ptr: *mut core::ffi::c_void) -> &'static mut Self;
}

pub trait Dispatcher<C: Cast>: Sized {
    fn dispatch() -> C;
}