Trait leaf_protocol::Component

source ·
pub trait Component:
    HasBorshSchema
    + BorshDeserialize
    + BorshSerialize {
    // Required method
    fn schema_id() -> Digest;

    // Provided method
    fn make_data(&self) -> Result<ComponentData> { ... }
}
Expand description

Trait implemented by Components in the Leaf data model.

Implementers should usually derive this using the Component macro.

Required Methods§

source

fn schema_id() -> Digest

Returns the digest of the schema for this component.

Provided Methods§

Object Safety§

This trait is not object safe.

Implementors§