Crate tasm_object_derive

Source
Expand description

This crate provides a derive macro for the TasmObject trait.

Example usage:

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

notes:

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

  2. If the target struct has a where clause with a trailing comma, compilation will fail.

    See also: https://github.com/TritonVM/tasm-lib/issues/91

    Example: do not do this.

#[derive(BFieldCodec, TasmObject)]
struct Foo<T>
where
    T: BFieldCodec, { … }
//                ^

Derive Macros§