[][src]Struct arangors::index::Index

pub struct Index {
    pub fields: Vec<String>,
    pub name: String,
    pub id: String,
    pub is_newly_created: Option<bool>,
    pub selectivity_estimate: Option<u8>,
    pub in_background: Option<bool>,
    pub settings: IndexSettings,
}

Represents an Index in ArangoDB. The following types are supported:

  • Fulltext
  • Geo
  • Hash
  • Persistent
  • Skiplist
  • Ttl (Time to live)

As different settings may be applied to different index types, use the [settings] field on the index to specify the exact type of the index including the required settings.

Example


let database = conn.db("test_db").await.unwrap();

let index = Index::builder()
    .name("doc_test_index_name")
    .fields(vec!["password".to_string()])
    .settings(IndexSettings::Persistent {
        unique: true,
        sparse: false,
        deduplicate: false,
    })
    .build();

let index = database.create_index("test_collection", &index).await?;
let delete_result = database.delete_index(&index.id).await.unwrap();

Fields

fields: Vec<String>name: Stringid: Stringis_newly_created: Option<bool>selectivity_estimate: Option<u8>in_background: Option<bool>settings: IndexSettings

Implementations

impl Index[src]

pub fn builder() -> IndexBuilder<((), (), (), (), (), (), ())>[src]

Create a builder for building Index. On the builder, call .fields(...)(optional), .name(...)(optional), .id(...)(optional), .is_newly_created(...)(optional), .selectivity_estimate(...)(optional), .in_background(...)(optional), .settings(...)(optional) to set the values of the fields (they accept Into values). Finally, call .build() to create the instance of Index.

Trait Implementations

impl Debug for Index[src]

impl Default for Index[src]

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

impl Serialize for Index[src]

Auto Trait Implementations

impl RefUnwindSafe for Index

impl Send for Index

impl Sync for Index

impl Unpin for Index

impl UnwindSafe for Index

Blanket Implementations

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

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

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

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

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.