Crate tasm_object_derive

Source
Expand description

This crate provides a derive macro for the TasmObject and TasmStruct traits.

Example usage:

#[derive(BFieldCodec, TasmObject)]
struct Foo<T: BFieldCodec> {
    t_list: Vec<T>,
}

Note: An implementation of BFieldCodec is required, else compilation will fail. It is recommended to derive BFieldCodec.

§Known limitations

  • Ignoring fields in tuple structs is currently not supported. Consider using a struct with named fields instead.

    #[derive(BFieldCodec, TasmObject)]
    struct Foo(#[tasm_object(ignore)] u32);
    //         ~~~~~~~~~~~~~~~~~~~~~~
    //         currently unsupported in tuple structs

Derive Macros§

TasmObject
Derives both, TasmObject and TasmStruct for structs.