pub struct ComputedFields { /* private fields */ }Expand description
Computed field registry
Implementations§
Source§impl ComputedFields
impl ComputedFields
pub fn new() -> Self
Sourcepub fn register(
&mut self,
collection: impl Into<String>,
field: impl Into<String>,
expression: ComputedExpression,
)
pub fn register( &mut self, collection: impl Into<String>, field: impl Into<String>, expression: ComputedExpression, )
Register a computed field
Sourcepub fn apply(&self, collection: &str, doc: &mut Document) -> Result<()>
pub fn apply(&self, collection: &str, doc: &mut Document) -> Result<()>
Apply computed fields to a document
Sourcepub fn get_fields(
&self,
collection: &str,
) -> Option<&HashMap<String, ComputedExpression>>
pub fn get_fields( &self, collection: &str, ) -> Option<&HashMap<String, ComputedExpression>>
Get computed fields for a collection
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ComputedFields
impl RefUnwindSafe for ComputedFields
impl Send for ComputedFields
impl Sync for ComputedFields
impl Unpin for ComputedFields
impl UnwindSafe for ComputedFields
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more