Struct tarantool::index::Builder

source ·
pub struct Builder<'a> { /* private fields */ }

Implementations§

source§

impl<'a> Builder<'a>

source

pub fn new(space_id: SpaceId, name: &'a str) -> Self

Creates a new index builder with default options.

source

pub fn index_type(self, type: IndexType) -> Self

source

pub fn id(self, id: SpaceId) -> Self

source

pub fn unique(self, unique: bool) -> Self

source

pub fn if_not_exists(self, if_not_exists: bool) -> Self

source

pub fn dimension(self, dimension: u32) -> Self

source

pub fn distance(self, distance: RtreeIndexDistanceType) -> Self

source

pub fn bloom_fpr(self, bloom_fpr: f32) -> Self

source

pub fn page_size(self, page_size: u32) -> Self

source

pub fn range_size(self, range_size: u32) -> Self

source

pub fn run_count_per_level(self, run_count_per_level: u32) -> Self

source

pub fn run_size_ratio(self, run_size_ratio: f32) -> Self

source

pub fn sequence(self, sequence: impl Into<SequenceOpt>) -> Self

source

pub fn func(self, func: String) -> Self

source

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.

source

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();
source

pub fn create(self) -> Result<Index>

Create a new index using the current options.

source

pub fn into_parts(self) -> (u32, &'a str, IndexOptions)

Destructure the builder struct into a tuple of space_id, name and index options.

Auto Trait Implementations§

§

impl<'a> Freeze for Builder<'a>

§

impl<'a> RefUnwindSafe for Builder<'a>

§

impl<'a> Send for Builder<'a>

§

impl<'a> Sync for Builder<'a>

§

impl<'a> Unpin for Builder<'a>

§

impl<'a> UnwindSafe for Builder<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.