Skip to main content

qdrant_client/qdrant_client/conversions/
payloads.rs

1use crate::qdrant::payload_index_params::IndexParams;
2use crate::qdrant::{
3    BoolIndexParams, BoolIndexParamsBuilder, DatetimeIndexParams, DatetimeIndexParamsBuilder,
4    FloatIndexParams, FloatIndexParamsBuilder, GeoIndexParams, GeoIndexParamsBuilder,
5    IntegerIndexParams, IntegerIndexParamsBuilder, KeywordIndexParams, KeywordIndexParamsBuilder,
6    PayloadIndexParams, TextIndexParams, TextIndexParamsBuilder, UuidIndexParams,
7    UuidIndexParamsBuilder,
8};
9
10impl From<IndexParams> for PayloadIndexParams {
11    fn from(value: IndexParams) -> Self {
12        Self {
13            index_params: Some(value),
14        }
15    }
16}
17
18impl From<TextIndexParams> for IndexParams {
19    fn from(value: TextIndexParams) -> Self {
20        Self::TextIndexParams(value)
21    }
22}
23
24impl From<TextIndexParamsBuilder> for IndexParams {
25    fn from(value: TextIndexParamsBuilder) -> Self {
26        Self::TextIndexParams(value.build())
27    }
28}
29
30impl From<TextIndexParams> for PayloadIndexParams {
31    fn from(value: TextIndexParams) -> Self {
32        Self {
33            index_params: Some(IndexParams::from(value)),
34        }
35    }
36}
37
38impl From<IntegerIndexParams> for IndexParams {
39    fn from(value: IntegerIndexParams) -> Self {
40        Self::IntegerIndexParams(value)
41    }
42}
43
44impl From<IntegerIndexParamsBuilder> for IndexParams {
45    fn from(value: IntegerIndexParamsBuilder) -> Self {
46        Self::IntegerIndexParams(value.build())
47    }
48}
49
50impl From<IntegerIndexParams> for PayloadIndexParams {
51    fn from(value: IntegerIndexParams) -> Self {
52        Self {
53            index_params: Some(IndexParams::from(value)),
54        }
55    }
56}
57
58impl From<KeywordIndexParams> for IndexParams {
59    fn from(value: KeywordIndexParams) -> Self {
60        Self::KeywordIndexParams(value)
61    }
62}
63
64impl From<KeywordIndexParamsBuilder> for IndexParams {
65    fn from(value: KeywordIndexParamsBuilder) -> Self {
66        Self::KeywordIndexParams(value.build())
67    }
68}
69
70impl From<FloatIndexParams> for IndexParams {
71    fn from(value: FloatIndexParams) -> Self {
72        Self::FloatIndexParams(value)
73    }
74}
75
76impl From<FloatIndexParamsBuilder> for IndexParams {
77    fn from(value: FloatIndexParamsBuilder) -> Self {
78        Self::FloatIndexParams(value.build())
79    }
80}
81
82impl From<DatetimeIndexParams> for IndexParams {
83    fn from(value: DatetimeIndexParams) -> Self {
84        Self::DatetimeIndexParams(value)
85    }
86}
87
88impl From<DatetimeIndexParamsBuilder> for IndexParams {
89    fn from(value: DatetimeIndexParamsBuilder) -> Self {
90        Self::DatetimeIndexParams(value.build())
91    }
92}
93
94impl From<UuidIndexParams> for IndexParams {
95    fn from(value: UuidIndexParams) -> Self {
96        Self::UuidIndexParams(value)
97    }
98}
99
100impl From<UuidIndexParamsBuilder> for IndexParams {
101    fn from(value: UuidIndexParamsBuilder) -> Self {
102        Self::UuidIndexParams(value.build())
103    }
104}
105
106impl From<BoolIndexParams> for IndexParams {
107    fn from(value: BoolIndexParams) -> Self {
108        Self::BoolIndexParams(value)
109    }
110}
111
112impl From<BoolIndexParamsBuilder> for IndexParams {
113    fn from(value: BoolIndexParamsBuilder) -> Self {
114        Self::BoolIndexParams(value.build())
115    }
116}
117
118impl From<GeoIndexParams> for IndexParams {
119    fn from(value: GeoIndexParams) -> Self {
120        Self::GeoIndexParams(value)
121    }
122}
123
124impl From<GeoIndexParamsBuilder> for IndexParams {
125    fn from(value: GeoIndexParamsBuilder) -> Self {
126        Self::GeoIndexParams(value.build())
127    }
128}