pub struct AssertionRegistry { /* private fields */ }Expand description
Assertion types by name.
Implementations§
Source§impl AssertionRegistry
impl AssertionRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
The built-in deterministic, performance, trajectory, retrieval and
verdict types. judge needs a workflow loader: see crate::judge::register.
Sourcepub fn register(
&mut self,
kind: impl Into<String>,
factory: impl Fn(&AssertionSpec) -> Result<Box<dyn Assertion>, EvalError> + Send + Sync + 'static,
) -> &mut Self
pub fn register( &mut self, kind: impl Into<String>, factory: impl Fn(&AssertionSpec) -> Result<Box<dyn Assertion>, EvalError> + Send + Sync + 'static, ) -> &mut Self
Register (or replace) an assertion type. Names must not start with not-.
Sourcepub fn prepare(
&self,
spec: &AssertionSpec,
) -> Result<PreparedAssertion, EvalError>
pub fn prepare( &self, spec: &AssertionSpec, ) -> Result<PreparedAssertion, EvalError>
Build an assertion from a spec whose values are already rendered.
Trait Implementations§
Source§impl Clone for AssertionRegistry
impl Clone for AssertionRegistry
Source§impl Debug for AssertionRegistry
impl Debug for AssertionRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for AssertionRegistry
impl !UnwindSafe for AssertionRegistry
impl Forget for AssertionRegistry
impl Freeze for AssertionRegistry
impl Move for AssertionRegistry
impl Send for AssertionRegistry
impl Sync for AssertionRegistry
impl Unpin for AssertionRegistry
impl UnsafeUnpin for AssertionRegistry
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