pub trait MongoCollection {
const NAME: &'static str;
const SCHEMA_VERSION: i32;
}
Expand description
Trait that is implemented automatically on each collection struct by [mongo_db
].
Required Associated Constants§
Sourceconst SCHEMA_VERSION: i32
const SCHEMA_VERSION: i32
The collection’s schema version.
Change that in your mongo_db!
invocation every time you change your schema.
You do not actually need to use this in your schema, but it is implemented for your convinience.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.