[][src]Trait mongodm::Model

pub trait Model: Serialize + DeserializeOwned {
    fn collection_name() -> &'static str;

    fn collection_options() -> Option<CollectionOptions> { ... }
fn indexes() -> Indexes { ... } }

Define collection configuration and associated indexes. Model can't be made into a trait object.

Required methods

fn collection_name() -> &'static str

Collection name to use when creating a mongodb::Collection instance

Loading content...

Provided methods

fn collection_options() -> Option<CollectionOptions>

mongodb::options::CollectionOptions to be used when creating a mongodb::Collection instance.

This method has a default implementation returning None. In such case configuration is defined by the mongodb::Database used on Repository creation.

fn indexes() -> Indexes

Configure how indexes should be created and synchronized for the associated collection.

Loading content...

Implementors

Loading content...