pub struct GlobalsRegistry { /* private fields */ }Expand description
Global variables registry Thread-safe storage for global variables shared across rules
Implementations§
Source§impl GlobalsRegistry
impl GlobalsRegistry
Sourcepub fn define(&self, name: impl Into<String>, value: FactValue) -> Result<()>
pub fn define(&self, name: impl Into<String>, value: FactValue) -> Result<()>
Define a global variable
Sourcepub fn define_readonly(
&self,
name: impl Into<String>,
value: FactValue,
) -> Result<()>
pub fn define_readonly( &self, name: impl Into<String>, value: FactValue, ) -> Result<()>
Define a read-only global variable
Sourcepub fn list_globals(&self) -> Vec<String>
pub fn list_globals(&self) -> Vec<String>
List all global variable names
Trait Implementations§
Source§impl Clone for GlobalsRegistry
impl Clone for GlobalsRegistry
Source§fn clone(&self) -> GlobalsRegistry
fn clone(&self) -> GlobalsRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GlobalsRegistry
impl Debug for GlobalsRegistry
Auto Trait Implementations§
impl Freeze for GlobalsRegistry
impl RefUnwindSafe for GlobalsRegistry
impl Send for GlobalsRegistry
impl Sync for GlobalsRegistry
impl Unpin for GlobalsRegistry
impl UnwindSafe for GlobalsRegistry
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