pub struct ContextBuilder<'a> { /* private fields */ }Expand description
Builder for constructing an IndexedContext. Obtained from
RuleSet::context_builder().
Field paths are resolved to integer indices using the compiled ruleset’s field registry. Unknown fields (not referenced by any rule) are silently ignored.
Implementations§
Source§impl<'a> ContextBuilder<'a>
impl<'a> ContextBuilder<'a>
Sourcepub fn set(self, path: &str, value: impl Into<Value>) -> Self
pub fn set(self, path: &str, value: impl Into<Value>) -> Self
Set a field value by path. If the path is not referenced by any rule in the compiled ruleset, the value is silently ignored.
Sourcepub fn insert(&mut self, path: &str, value: impl Into<Value>)
pub fn insert(&mut self, path: &str, value: impl Into<Value>)
Set a field value by path (mutable reference version).
Sourcepub fn build(self) -> IndexedContext
pub fn build(self) -> IndexedContext
Build the indexed context.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ContextBuilder<'a>
impl<'a> RefUnwindSafe for ContextBuilder<'a>
impl<'a> Send for ContextBuilder<'a>
impl<'a> Sync for ContextBuilder<'a>
impl<'a> Unpin for ContextBuilder<'a>
impl<'a> UnsafeUnpin for ContextBuilder<'a>
impl<'a> UnwindSafe for ContextBuilder<'a>
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