#[derive(TypeId)]
{
// Attributes available to this derive:
#[response]
}
Expand description
Marks the type with a generated unique type id that distinct among generics and package versions.
Use #[response(<ResponseType>)]
to apply a response type so that it could be called on rpc calls.
If the type name ends with Request
, then a response attribute is automatically added with the suffix of Response
by convention.
Examples
use tea_codec_macros::TypeId;
#[derive(TypeId)]
// a `#[response(GetSystemTimeResponse)]` is automatically added by convention.
pub struct GetSystemTimeRequest;
#[derive(TypeId)]
pub struct GetSystemTimeResponse(pub u128);