Skip to main content

Automorph

Derive Macro Automorph 

Source
#[derive(Automorph)]
{
    // Attributes available to this derive:
    #[automorph]
}
Expand description

Derive the Automorph trait for a struct or enum.

§Example

use automorph::Automorph;

#[derive(Automorph, Default, Clone)]
struct Person {
    name: String,
    age: u64,
}

This generates an implementation that stores the struct as an Automerge Map with each field as a key.