Skip to main content

CollectionConfig

Trait CollectionConfig 

Source
pub trait CollectionConfig {
    // Required method
    fn collection_name() -> &'static str;

    // Provided methods
    fn collection_options() -> Option<CollectionOptions> { ... }
    fn indexes() -> Indexes { ... }
}
Expand description

Define collection name, configuration and associated indexes.

Required Methods§

Source

fn collection_name() -> &'static str

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

Provided Methods§

Source

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.

Source

fn indexes() -> Indexes

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

This method has a default implementation returning no index (only special _id index will be present).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§