pub struct Builder<'a> { /* private fields */ }
Implementations§
source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
sourcepub fn new(space_id: u32, name: &'a str) -> Self
pub fn new(space_id: u32, name: &'a str) -> Self
Creates a new index builder with default options.
pub fn index_type(self, type: IndexType) -> Self
pub fn id(self, id: u32) -> Self
pub fn unique(self, unique: bool) -> Self
pub fn if_not_exists(self, if_not_exists: bool) -> Self
pub fn dimension(self, dimension: u32) -> Self
pub fn distance(self, distance: RtreeIndexDistanceType) -> Self
pub fn bloom_fpr(self, bloom_fpr: f32) -> Self
pub fn page_size(self, page_size: u32) -> Self
pub fn range_size(self, range_size: u32) -> Self
pub fn run_count_per_level(self, run_count_per_level: u32) -> Self
pub fn run_size_ratio(self, run_size_ratio: f32) -> Self
pub fn sequence(self, sequence: impl Into<SequenceOpt>) -> Self
pub fn func(self, func: String) -> Self
sourcepub fn part(self, part: impl Into<Part>) -> Self
pub fn part(self, part: impl Into<Part>) -> Self
Add a part to the index’s parts list.
Use this method to set each part individually or use parts
to set
parts in bulk. The difference is purely syntactical.
sourcepub fn parts(self, parts: impl IntoIterator<Item = impl Into<Part>>) -> Self
pub fn parts(self, parts: impl IntoIterator<Item = impl Into<Part>>) -> Self
Add parts to the index’s parts list.
Use this method to set parts in bulk or use part
to set
each part individually. The difference is purely syntactical.
use tarantool::{space::Space, index::FieldType as FT};
Space::find("t").unwrap()
.index_builder("by_index_and_type")
.parts([(0, FT::Unsigned), (1, FT::String)])
.create();
Space::find("t").unwrap()
.index_builder("by_name")
.parts(["foo", "bar", "baz"])
.create();
sourcepub fn into_parts(self) -> (u32, &'a str, IndexOptions)
pub fn into_parts(self) -> (u32, &'a str, IndexOptions)
Destructure the builder struct into a tuple of space_id, name and index options.