qdrant_client/builders/
bool_index_params_builder.rsuse crate::qdrant::*;
pub struct BoolIndexParamsBuilder {
pub(crate) on_disk: Option<Option<bool>>,
}
impl Default for BoolIndexParamsBuilder {
fn default() -> Self {
Self::new()
}
}
impl BoolIndexParamsBuilder {
pub fn new() -> Self {
Self::create_empty()
}
#[allow(unused_mut)]
pub fn on_disk(self, value: bool) -> Self {
let mut new = self;
new.on_disk = Option::Some(Option::Some(value));
new
}
fn build_inner(self) -> Result<BoolIndexParams, std::convert::Infallible> {
Ok(BoolIndexParams {
on_disk: self.on_disk.unwrap_or_default(),
})
}
fn create_empty() -> Self {
Self {
on_disk: core::default::Default::default(),
}
}
}
impl From<BoolIndexParamsBuilder> for BoolIndexParams {
fn from(value: BoolIndexParamsBuilder) -> Self {
value.build_inner().unwrap_or_else(|_| {
panic!(
"Failed to convert {0} to {1}",
"BoolIndexParamsBuilder", "BoolIndexParams"
)
})
}
}
impl BoolIndexParamsBuilder {
pub fn build(self) -> BoolIndexParams {
self.build_inner().unwrap_or_else(|_| {
panic!(
"Failed to build {0} into {1}",
"BoolIndexParamsBuilder", "BoolIndexParams"
)
})
}
}