Skip to main content

StableId

Derive Macro StableId 

Source
#[derive(StableId)]
Expand description

Derive the StableId trait for a type.

The generated TYPE_ID is the first 16 bytes of the SHA-256 digest of the type’s fully-qualified path (module_path!() + "::" + ident).

If the type contains type generic parameters, the generated TYPE_ID is combined with each type generic parameter’s TYPE_ID with StableTypeId::combine in their declaration order.

If the type contains const generic parameters, the generated TYPE_ID is combined with the first 16 bytes of the SHA-256 digest of the big-endian form of each const generic parameter with StableTypeId::combine in their declaration order.

§Example

use acktor_derive::StableId;

#[derive(StableId)]
struct Ping(u64);