Struct arangors::index::Index [−][src]
pub struct Index { pub fields: Vec<String>, pub name: String, pub id: String, pub is_newly_created: Option<bool>, pub selectivity_estimate: Option<f32>, 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: String
id: String
is_newly_created: Option<bool>
selectivity_estimate: Option<f32>
in_background: Option<bool>
settings: IndexSettings
Implementations
impl Index
[src]
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.
Finally, call .build()
to create the instance of Index
.
Trait Implementations
impl<'de> Deserialize<'de> for Index
[src]
impl<'de> Deserialize<'de> for Index
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Index
impl RefUnwindSafe for Index
impl UnwindSafe for Index
impl UnwindSafe for Index
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]