[−][src]Derive Macro automate::Stored
#[derive(Stored)] { // Attributes available to this derive: #[storage] }
Derive macro for a stored struct.
Simply implements the Stored trait on the given type.
If not specified, the storage will be assumed to be
the name of the struct concatenated with Storage
.
So a stored Count
struct would define its storage
to be CountStorage
.
It is possible to change the storage struct by using the storage helper attribute like this :
use automate::{Stored, Storage}; #[derive(Stored)] #[storage(Counter)] //the storage is now the `Counter` struct struct Count(i32); #[derive(Storage)] struct Counter;