pub struct Engine { /* private fields */ }Expand description
Shared, thread-safe query engine.
Internally a Mutex<VM>; reads serialise but compilation and caching
happen once per expression, so the lock is held only for the duration
of an execute call. For single-threaded use prefer [Jetro], which
keeps a dedicated VM per thread.
Implementations§
Source§impl Engine
impl Engine
pub fn new() -> Arc<Self>
pub fn with_capacity(compile_cap: usize, path_cap: usize) -> Arc<Self>
pub fn with_methods(registry: Arc<MethodRegistry>) -> Arc<Self>
Sourcepub fn run(&self, expr: &str, doc: &Value) -> Result<Value>
pub fn run(&self, expr: &str, doc: &Value) -> Result<Value>
Parse, compile (cached), and execute expr against doc.
pub fn register(&self, name: impl Into<String>, method: impl Method + 'static)
pub fn set_pass_config(&self, config: PassConfig)
pub fn pass_config(&self) -> PassConfig
Auto Trait Implementations§
impl !Freeze for Engine
impl !RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl !UnwindSafe for Engine
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