Trait MongoCollection

Source
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§

Source

const NAME: &'static str

The collection’s name.

Source

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.

Implementors§