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