pub struct SyncMetricAdapter<M: Metric>(pub M);Expand description
Wraps a sync Metric impl as an AsyncMetric.
Tuple Fields§
§0: MTrait Implementations§
Source§impl<M: Metric> AsyncMetric for SyncMetricAdapter<M>
impl<M: Metric> AsyncMetric for SyncMetricAdapter<M>
Source§fn score<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
input: &'life1 str,
actual_output: &'life2 str,
expected_keywords: &'life3 [&'life4 str],
) -> Pin<Box<dyn Future<Output = f64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn score<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
input: &'life1 str,
actual_output: &'life2 str,
expected_keywords: &'life3 [&'life4 str],
) -> Pin<Box<dyn Future<Output = f64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Score the actual output. Read more
Auto Trait Implementations§
impl<M> Freeze for SyncMetricAdapter<M>where
M: Freeze,
impl<M> RefUnwindSafe for SyncMetricAdapter<M>where
M: RefUnwindSafe,
impl<M> Send for SyncMetricAdapter<M>
impl<M> Sync for SyncMetricAdapter<M>
impl<M> Unpin for SyncMetricAdapter<M>where
M: Unpin,
impl<M> UnsafeUnpin for SyncMetricAdapter<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for SyncMetricAdapter<M>where
M: UnwindSafe,
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