pub struct IndexBuilder { /* private fields */ }Expand description
Fluent builder for index creation.
§Example
ⓘ
use interstellar::index::IndexBuilder;
// B+ tree index on person.age
let spec = IndexBuilder::vertex()
.label("person")
.property("age")
.build()?;
// Unique index on user.email
let spec = IndexBuilder::vertex()
.label("user")
.property("email")
.unique()
.build()?;
// Edge index
let spec = IndexBuilder::edge()
.label("purchased")
.property("amount")
.build()?;Implementations§
Source§impl IndexBuilder
impl IndexBuilder
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Set the label filter (only index elements with this label).
Sourcepub fn property(self, property: impl Into<String>) -> Self
pub fn property(self, property: impl Into<String>) -> Self
Set the property to index (required).
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set explicit index name (default: auto-generated).
Sourcepub fn build(self) -> Result<IndexSpec, IndexError>
pub fn build(self) -> Result<IndexSpec, IndexError>
Build the index specification.
§Errors
Returns IndexError::MissingProperty if the property was not set.
Trait Implementations§
Source§impl Clone for IndexBuilder
impl Clone for IndexBuilder
Source§fn clone(&self) -> IndexBuilder
fn clone(&self) -> IndexBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IndexBuilder
impl RefUnwindSafe for IndexBuilder
impl Send for IndexBuilder
impl Sync for IndexBuilder
impl Unpin for IndexBuilder
impl UnwindSafe for IndexBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more