[][src]Struct mongodb::coll::options::IndexModel

pub struct IndexModel {
    pub keys: Document,
    pub options: IndexOptions,
}

A single index model.

Fields

keys: Documentoptions: IndexOptions

Methods

impl IndexModel[src]

pub fn new(keys: Document, options: Option<IndexOptions>) -> IndexModel[src]

pub fn name(&self) -> Result<String>[src]

Returns the name of the index as specified by the options, or as automatically generated using the keys.

pub fn generate_index_name(&self) -> Result<String>[src]

Generates the index name from keys. Auto-generated names have the form "key1_val1_key2_val2..."

pub fn to_bson(&self) -> Result<Document>[src]

Converts the model to its BSON document representation.

Trait Implementations

impl Clone for IndexModel[src]

impl PartialEq<IndexModel> for IndexModel[src]

impl Debug for IndexModel[src]

impl<'de> Deserialize<'de> for IndexModel[src]

impl Serialize for IndexModel[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self