pub struct CompiledLogicStore { /* private fields */ }Expand description
Storage for compiled logic expressions with dependency tracking
This store uses the global compiled logic cache to avoid recompiling the same logic across different instances. Each instance maintains its own local ID mapping to the global storage.
Implementations§
Source§impl CompiledLogicStore
impl CompiledLogicStore
pub fn new() -> Self
Sourcepub fn compile(&mut self, logic: &Value) -> Result<LogicId, String>
pub fn compile(&mut self, logic: &Value) -> Result<LogicId, String>
Compile and store a JSON Logic expression
Uses global storage to avoid recompiling the same logic across instances. The logic is compiled once globally and reused, with this instance maintaining its own local ID for tracking dependencies.
Sourcepub fn get(&self, id: &LogicId) -> Option<&CompiledLogic>
pub fn get(&self, id: &LogicId) -> Option<&CompiledLogic>
Get a compiled logic by ID
Sourcepub fn remove(&mut self, id: &LogicId) -> Option<CompiledLogic>
pub fn remove(&mut self, id: &LogicId) -> Option<CompiledLogic>
Remove a compiled logic by ID
Sourcepub fn get_dependencies(&self, id: &LogicId) -> Option<&[String]>
pub fn get_dependencies(&self, id: &LogicId) -> Option<&[String]>
Get dependencies for a logic ID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledLogicStore
impl RefUnwindSafe for CompiledLogicStore
impl Send for CompiledLogicStore
impl Sync for CompiledLogicStore
impl Unpin for CompiledLogicStore
impl UnwindSafe for CompiledLogicStore
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