Crate mongod_derive[−][src]
Mongo Derive
This crate provides two derives Bson
& Mongo
for the mongo
crate.
Examples
Deriving BSON
#[derive(Bson)] pub struct User { name: String, age: u32, }
Deriving Mongo
#[derive(Mongo)] #[mongo(collection = "users", field, filter, update)] pub struct User { name: String, age: u32, }
Derive Macros
Bson | Derives implementations for |
Mongo | Derives mongo traits on the decorated type. |