add setter to json object options (#1311)

This commit is contained in:
PSeitz
2022-03-16 02:36:30 +01:00
committed by GitHub
parent 59ec21479f
commit 8a5a12d961

View File

@@ -34,6 +34,20 @@ impl JsonObjectOptions {
pub fn get_text_indexing_options(&self) -> Option<&TextFieldIndexing> {
self.indexing.as_ref()
}
/// Sets the field as stored
#[must_use]
pub fn set_stored(mut self) -> Self {
self.stored = true;
self
}
/// Sets the field as indexed, with the specific indexing options.
#[must_use]
pub fn set_indexing_options(mut self, indexing: TextFieldIndexing) -> Self {
self.indexing = Some(indexing);
self
}
}
impl From<StoredFlag> for JsonObjectOptions {