pub struct Callbacks<A, P, S, U, E, C>(/* private fields */);Expand description
A set of Terminators and/or Observers which can be used as an input to Algorithm::process.
Implementations§
Source§impl<A, P, S, U, E, C> Callbacks<A, P, S, U, E, C>
impl<A, P, S, U, E, C> Callbacks<A, P, S, U, E, C>
Sourcepub fn with_terminator<T>(self, terminator: T) -> Selfwhere
T: Terminator<A, P, S, U, E, C> + 'static,
pub fn with_terminator<T>(self, terminator: T) -> Selfwhere
T: Terminator<A, P, S, U, E, C> + 'static,
Return the set of Callbacks with an additional Terminator added.
Sourcepub fn with_observer<O>(self, observer: O) -> Selfwhere
O: Observer<A, P, S, U, E, C> + 'static,
pub fn with_observer<O>(self, observer: O) -> Selfwhere
O: Observer<A, P, S, U, E, C> + 'static,
Sourcepub fn check_for_termination(
&mut self,
current_step: usize,
algorithm: &mut A,
problem: &P,
status: &mut S,
args: &U,
config: &C,
) -> ControlFlow<()>
pub fn check_for_termination( &mut self, current_step: usize, algorithm: &mut A, problem: &P, status: &mut S, args: &U, config: &C, ) -> ControlFlow<()>
Runs all of the contained Terminators and Observers and returns ControlFlow::Break if any of the terminators return ControlFlow::Break.
Trait Implementations§
Auto Trait Implementations§
impl<A, P, S, U, E, C> Freeze for Callbacks<A, P, S, U, E, C>
impl<A, P, S, U, E, C> !RefUnwindSafe for Callbacks<A, P, S, U, E, C>
impl<A, P, S, U, E, C> !Send for Callbacks<A, P, S, U, E, C>
impl<A, P, S, U, E, C> !Sync for Callbacks<A, P, S, U, E, C>
impl<A, P, S, U, E, C> Unpin for Callbacks<A, P, S, U, E, C>
impl<A, P, S, U, E, C> UnsafeUnpin for Callbacks<A, P, S, U, E, C>
impl<A, P, S, U, E, C> !UnwindSafe for Callbacks<A, P, S, U, E, C>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.