Trait 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§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§