pub enum AnytimeStatus<Q> {
Improved(Q),
Converged(Q),
Aborted,
}Expand description
Returned by CuAnytimeTask::base and CuAnytimeTask::refine; drives the
runtime’s refinement scheduling.
Q is CuAnytimeTask::Quality: Quality for tasks that can score their
result, () for tasks that cannot.
After any Ok return, the output must be valid and hold the best result produced
so far for the current job: a quantum that regresses or plateaus keeps its
candidate in task-local state and leaves the output untouched. The runtime never
buffers or rolls back the output, so it can publish it at any stop point, and the
published quality is monotone even when the algorithm internally is not.
Variants§
Improved(Q)
The output holds the best result so far; further refinement may help.
Converged(Q)
Proactive yield: no further improvement is possible for this job. The output holds the final result, published unless the quality floor rejects it.
Aborted
Proactive give-up: the algorithm diverged or reached an unrecoverable state for this job. Refinement stops; the output is published as-is — subject to the quality floor once a quality has been reported — so a task that can no longer vouch even for its base result must clear the payload before returning this. The next copperlist starts a fresh job.
Trait Implementations§
Source§impl<Q: Clone> Clone for AnytimeStatus<Q>
impl<Q: Clone> Clone for AnytimeStatus<Q>
Source§fn clone(&self) -> AnytimeStatus<Q>
fn clone(&self) -> AnytimeStatus<Q>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<Q: Copy> Copy for AnytimeStatus<Q>
Source§impl<Q: Debug> Debug for AnytimeStatus<Q>
impl<Q: Debug> Debug for AnytimeStatus<Q>
Source§impl<Q: PartialEq> PartialEq for AnytimeStatus<Q>
impl<Q: PartialEq> PartialEq for AnytimeStatus<Q>
Source§fn eq(&self, other: &AnytimeStatus<Q>) -> bool
fn eq(&self, other: &AnytimeStatus<Q>) -> bool
self and other values to be equal, and is used by ==.impl<Q: PartialEq> StructuralPartialEq for AnytimeStatus<Q>
Auto Trait Implementations§
impl<Q> Freeze for AnytimeStatus<Q>where
Q: Freeze,
impl<Q> RefUnwindSafe for AnytimeStatus<Q>where
Q: RefUnwindSafe,
impl<Q> Send for AnytimeStatus<Q>where
Q: Send,
impl<Q> Sync for AnytimeStatus<Q>where
Q: Sync,
impl<Q> Unpin for AnytimeStatus<Q>where
Q: Unpin,
impl<Q> UnsafeUnpin for AnytimeStatus<Q>where
Q: UnsafeUnpin,
impl<Q> UnwindSafe for AnytimeStatus<Q>where
Q: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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>
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>
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