qdrant_client/builders/
keyword_index_params_builder.rs1use crate::qdrant::*;
2
3#[derive(Clone)]
4pub struct KeywordIndexParamsBuilder {
5 pub(crate) is_tenant: Option<Option<bool>>,
7 pub(crate) on_disk: Option<Option<bool>>,
9}
10
11impl Default for KeywordIndexParamsBuilder {
12 fn default() -> Self {
13 Self::create_empty()
14 }
15}
16
17impl KeywordIndexParamsBuilder {
18 #[allow(unused_mut)]
20 pub fn is_tenant(self, value: bool) -> Self {
21 let mut new = self;
22 new.is_tenant = Option::Some(Option::Some(value));
23 new
24 }
25 #[allow(unused_mut)]
27 pub fn on_disk(self, value: bool) -> Self {
28 let mut new = self;
29 new.on_disk = Option::Some(Option::Some(value));
30 new
31 }
32
33 fn build_inner(self) -> Result<KeywordIndexParams, std::convert::Infallible> {
34 Ok(KeywordIndexParams {
35 is_tenant: self.is_tenant.unwrap_or_default(),
36 on_disk: self.on_disk.unwrap_or_default(),
37 })
38 }
39 fn create_empty() -> Self {
41 Self {
42 is_tenant: core::default::Default::default(),
43 on_disk: core::default::Default::default(),
44 }
45 }
46}
47
48impl From<KeywordIndexParamsBuilder> for KeywordIndexParams {
49 fn from(value: KeywordIndexParamsBuilder) -> Self {
50 value.build_inner().unwrap_or_else(|_| {
51 panic!(
52 "Failed to convert {0} to {1}",
53 "KeywordIndexParamsBuilder", "KeywordIndexParams"
54 )
55 })
56 }
57}
58
59impl KeywordIndexParamsBuilder {
60 pub fn build(self) -> KeywordIndexParams {
62 self.build_inner().unwrap_or_else(|_| {
63 panic!(
64 "Failed to build {0} into {1}",
65 "KeywordIndexParamsBuilder", "KeywordIndexParams"
66 )
67 })
68 }
69}