[][src]Struct avocado::prelude::IndexModel

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

A single index model.

Fields

keys: OrderedDocumentoptions: IndexOptions

Methods

impl IndexModel
[src]

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

pub fn name(&self) -> Result<String, Error>
[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, Error>
[src]

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

pub fn to_bson(&self) -> Result<OrderedDocument, Error>
[src]

Converts the model to its BSON document representation.

Trait Implementations

impl Clone for IndexModel
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for IndexModel
[src]

impl PartialEq<IndexModel> for IndexModel
[src]

Auto Trait Implementations

impl Send for IndexModel

impl Sync for IndexModel

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

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

impl<T> Same for T

type Output = T

Should always be Self