#[non_exhaustive]pub struct SolverStep<S: State> {
pub state: S,
pub completed: bool,
pub termination: Option<Termination<S::Float>>,
}Expand description
Progress published by one solver step. Completion and termination are independent: a finished step can also be the step that stops the run. A continuing partial step publishes progress without an iteration callback.
Construct steps with Self::new or the named constructors. Fields remain
public for reading, moving, and assignment; destructuring must include ...
Future optional metadata must default to behavior compatible with existing
constructors.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.state: SCoherent progress published by this step.
completed: boolWhether the executor should increment the completed-iteration count.
termination: Option<Termination<S::Float>>An optional stopping decision, independent of iteration completion.
Implementations§
Source§impl<S: State> SolverStep<S>
impl<S: State> SolverStep<S>
Sourcepub fn new(
state: S,
completed: bool,
termination: Option<Termination<S::Float>>,
) -> Self
pub fn new( state: S, completed: bool, termination: Option<Termination<S::Float>>, ) -> Self
Publish a step with explicit completion and termination decisions.
Use this when forwarding decisions from another solver. Completion and termination remain independent.
Sourcepub fn partial(state: S) -> Self
pub fn partial(state: S) -> Self
Publish progress and continue without completing an iteration.
The executor publishes counts and incumbent updates without incrementing the completed-iteration count or firing iteration observers.
Sourcepub fn stopped(state: S, termination: Termination<S::Float>) -> Self
pub fn stopped(state: S, termination: Termination<S::Float>) -> Self
Publish a partial step and its stopping explanation.
Sourcepub fn completed_with_termination(
state: S,
termination: Termination<S::Float>,
) -> Self
pub fn completed_with_termination( state: S, termination: Termination<S::Float>, ) -> Self
Publish a completed iteration and its stopping explanation.
Sourcepub fn into_parts(self) -> (S, bool, Option<Termination<S::Float>>)
pub fn into_parts(self) -> (S, bool, Option<Termination<S::Float>>)
Extract the published state, completion flag, and stopping decision.
Callers driving iterations manually must account for completed before
consuming this value. This tuple retains only these three core fields;
any future optional metadata is discarded.
Trait Implementations§
Source§impl<S: State> From<(S, Option<Termination<<S as State>::Float>>)> for SolverStep<S>
impl<S: State> From<(S, Option<Termination<<S as State>::Float>>)> for SolverStep<S>
Auto Trait Implementations§
impl<S> Freeze for SolverStep<S>
impl<S> RefUnwindSafe for SolverStep<S>
impl<S> Send for SolverStep<S>
impl<S> Sync for SolverStep<S>
impl<S> Unpin for SolverStep<S>
impl<S> UnsafeUnpin for SolverStep<S>
impl<S> UnwindSafe for SolverStep<S>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.