[][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 PartialEq<IndexModel> for IndexModel[src]

impl Debug 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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> UnsafeAny for T where
    T: Any