Crate agdb_derive

Crate agdb_derive 

Source

Attribute Macros§

impl_def

Derive Macros§

ApiDef
ApiDefImpl
DbElement
The same as DbType but additionally implements DbType::db_element_id() allowing more streamlined selection and search of strongly typed elements. This derive adds additional element property to the element representation in the database of type (String, String), i.e. ("db_element_id", <usertypename>.to_string()).
DbSerialize
The derive macro to add agdb platform agnostic serialization support. This is only needed if you want to serialize custom complex data structures and do not want or cannot use serde. It is primarily used internally to serialize the agdb data structures.
DbType
The derive macro to add agdb compatibility to user defined types. It implements [agdb::UserDbType] for the type automatically to allow your type to be read and stored from/to the database.
DbTypeMarker
The helper derive macro to add agdb compatibility to user defined types. This type provides blank implementation of the agdb::DbTypeMarker trait. This is needed for the vectorized custom values to be compatible with the database as the From trait implementation without it conflicts with the blanket implementations.
DbValue
The derive macro to allow automatically serializing user types into DbValue::Bytes. Useful when deriving DbType for a custom type with nested custom types or enums as it avoids the need to manually implement From/TryFrom for such nested types. It does additionally support enums and vectorized types (Vec<T>).