pub struct NativeTest { /* private fields */ }Expand description
A runtime whose functions are Rust closures, registered under the hash of the descriptor they implement. For tests only: nothing ties a closure to the descriptor’s body.
Implementations§
Source§impl NativeTest
impl NativeTest
Sourcepub fn new() -> NativeTest
pub fn new() -> NativeTest
A runtime with no functions.
Sourcepub fn register(
&mut self,
fn_hash: impl Into<String>,
f: impl Fn(&Cell, &mut dyn Inputs, &mut Budget) -> Result<Scalar, EvalError> + Send + Sync + 'static,
) -> &mut Self
pub fn register( &mut self, fn_hash: impl Into<String>, f: impl Fn(&Cell, &mut dyn Inputs, &mut Budget) -> Result<Scalar, EvalError> + Send + Sync + 'static, ) -> &mut Self
Registers f as the function whose descriptor hashes to fn_hash.
Sourcepub fn set_asof_dependent(&mut self, fn_hash: impl Into<String>) -> &mut Self
pub fn set_asof_dependent(&mut self, fn_hash: impl Into<String>) -> &mut Self
Declares the function whose descriptor hashes to fn_hash asof-dependent
(Runtime::asof_dependent). Since 0.3.0.
Trait Implementations§
Source§impl Clone for NativeTest
impl Clone for NativeTest
Source§impl Debug for NativeTest
impl Debug for NativeTest
Source§impl Default for NativeTest
impl Default for NativeTest
Source§impl Runtime for NativeTest
impl Runtime for NativeTest
Source§fn lang(&self) -> &str
fn lang(&self) -> &str
The language this runtime evaluates: a name (SPEC 2.2), e.g.
formula. stored is
the engine’s own (a lookup) and cannot be configured.Source§fn asof_dependent(&self, descriptor: &FunctionDescriptor) -> bool
fn asof_dependent(&self, descriptor: &FunctionDescriptor) -> bool
Whether the function is asof-dependent (SPEC 15.12: its body uses
asof() or a
bounded latest), derived from the descriptor alone. Its receipts then have the
evaluation asof as their asof, one per requested asof, and the engine never reuses
one for another asof, from the memo or from the store. Provided: false. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for NativeTest
impl !UnwindSafe for NativeTest
impl Forget for NativeTest
impl Freeze for NativeTest
impl Move for NativeTest
impl Send for NativeTest
impl Sync for NativeTest
impl Unpin for NativeTest
impl UnsafeUnpin for NativeTest
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