Crate trustfall_derive

Crate trustfall_derive 

Source
Expand description

Commonly-implemented functionality for Trustfall vertex types.

Trustfall vertex types are nearly always enums. Here’s the easiest way to make a Trustfall vertex:

#[derive(Debug, Clone, TrustfallEnumVertex)]
enum Vertex {
    // variants that match the type in your schema;
    // for example:
    User(Rc<User>),
    Message(Rc<Message>),
}

Derive Macros§

TrustfallEnumVertex
Adds the Typename trait and as_<variant>() methods on an enum used as a Trustfall vertex.
Typename
Derives the Typename trait on the enum being used as a Trustfall vertex.