pub struct RegexMatchEvaluator { /* private fields */ }Expand description
Evaluator that checks whether the prediction matches a regex pattern.
Implementations§
Source§impl RegexMatchEvaluator
impl RegexMatchEvaluator
Sourcepub fn new(pattern: &str) -> Result<Self, SynapticError>
pub fn new(pattern: &str) -> Result<Self, SynapticError>
Create a new regex match evaluator with the given pattern.
Returns an error if the pattern is not a valid regex.
Trait Implementations§
Source§impl Evaluator for RegexMatchEvaluator
impl Evaluator for RegexMatchEvaluator
Source§fn evaluate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prediction: &'life1 str,
_reference: &'life2 str,
_input: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<EvalResult, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prediction: &'life1 str,
_reference: &'life2 str,
_input: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<EvalResult, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Evaluate a prediction against a reference, given the original input.
Auto Trait Implementations§
impl Freeze for RegexMatchEvaluator
impl RefUnwindSafe for RegexMatchEvaluator
impl Send for RegexMatchEvaluator
impl Sync for RegexMatchEvaluator
impl Unpin for RegexMatchEvaluator
impl UnsafeUnpin for RegexMatchEvaluator
impl UnwindSafe for RegexMatchEvaluator
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