pub struct EarlyStopSink<F: FnMut(&Observation) -> bool> { /* private fields */ }Expand description
Early-stop sink — halts execution when a predicate matches.
Implementations§
Source§impl<F: FnMut(&Observation) -> bool> EarlyStopSink<F>
impl<F: FnMut(&Observation) -> bool> EarlyStopSink<F>
pub fn new(predicate: F) -> Self
pub fn into_observations(self) -> Vec<Observation>
Trait Implementations§
Source§impl<F: FnMut(&Observation) -> bool + Send> ObservationSink for EarlyStopSink<F>
impl<F: FnMut(&Observation) -> bool + Send> ObservationSink for EarlyStopSink<F>
Source§fn on_observation(&mut self, observation: &Observation) -> ControlFlow
fn on_observation(&mut self, observation: &Observation) -> ControlFlow
Called for each observation during execution. Read more
Source§fn on_complete(&mut self)
fn on_complete(&mut self)
Called when execution completes (normally or via halt).
Override to perform cleanup or final analysis.
Auto Trait Implementations§
impl<F> Freeze for EarlyStopSink<F>where
F: Freeze,
impl<F> RefUnwindSafe for EarlyStopSink<F>where
F: RefUnwindSafe,
impl<F> Send for EarlyStopSink<F>where
F: Send,
impl<F> Sync for EarlyStopSink<F>where
F: Sync,
impl<F> Unpin for EarlyStopSink<F>where
F: Unpin,
impl<F> UnsafeUnpin for EarlyStopSink<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for EarlyStopSink<F>where
F: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more