Crate tusk_rs_derive

Crate tusk_rs_derive 

Source
Expand description

Procedural macros used by the tusk-rs library.

Macros§

embed
Embed a file into the binary as a string. This is useful for HTML files or other static files that need to be represented as a string.
embed_binary
Embed a file into the binary as a byte array. This is useful for binary files that need to be represented as a byte array.

Derive Macros§

FromJson
Derive [tusk_rs::FromJson] for a struct.
FromPostgres
Derive the [tusk_rs::FromPostgres] trait for a struct.
JsonRetrieve
Derive [tusk_rs::JsonRetrieve] for an enum. Each variant name is expected to match its string representation in JSON.
PostgresJoins
Derive a default implementation of [tusk_rs::PostgresJoins] which returns no joins.
PostgresReadFields
Derive [tusk_rs::PostgresReadFields] by reading all struct fields.
PostgresReadable
Blanket derive for [tusk_rs::PostgresReadable].
PostgresWriteFields
Derive [tusk_rs::PostgresWriteFields] by using all struct fields.
PostgresWriteable
Derive [tusk_rs::PostgresWriteable] for a struct so it can be inserted or updated.
ToJson
Derive a ToJson implementation.