pub struct SolverRuntime<S>where
S: PlanningSolution,{ /* private fields */ }Expand description
Runtime context for a retained solve job.
This is passed into Solvable::solve() so the runtime path can publish
lifecycle events, settle exact pauses, and observe cancellation.
Implementations§
Source§impl<S> SolverRuntime<S>where
S: PlanningSolution,
impl<S> SolverRuntime<S>where
S: PlanningSolution,
pub fn job_id(&self) -> usize
pub fn is_cancel_requested(&self) -> bool
pub fn emit_progress( &self, current_score: Option<<S as PlanningSolution>::Score>, best_score: Option<<S as PlanningSolution>::Score>, telemetry: SolverTelemetry, )
pub fn emit_best_solution( &self, solution: S, current_score: Option<<S as PlanningSolution>::Score>, best_score: <S as PlanningSolution>::Score, telemetry: SolverTelemetry, )
pub fn emit_completed( &self, solution: S, current_score: Option<<S as PlanningSolution>::Score>, best_score: <S as PlanningSolution>::Score, telemetry: SolverTelemetry, terminal_reason: SolverTerminalReason, )
pub fn emit_cancelled( &self, current_score: Option<<S as PlanningSolution>::Score>, best_score: Option<<S as PlanningSolution>::Score>, telemetry: SolverTelemetry, )
pub fn emit_failed(&self, error: String)
pub fn pause_with_snapshot( &self, solution: S, current_score: Option<<S as PlanningSolution>::Score>, best_score: Option<<S as PlanningSolution>::Score>, telemetry: SolverTelemetry, ) -> bool
Trait Implementations§
Source§impl<S> Clone for SolverRuntime<S>where
S: PlanningSolution,
impl<S> Clone for SolverRuntime<S>where
S: PlanningSolution,
Source§fn clone(&self) -> SolverRuntime<S>
fn clone(&self) -> SolverRuntime<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S> Debug for SolverRuntime<S>where
S: PlanningSolution,
impl<S> Debug for SolverRuntime<S>where
S: PlanningSolution,
impl<S> Copy for SolverRuntime<S>where
S: PlanningSolution,
Auto Trait Implementations§
impl<S> Freeze for SolverRuntime<S>
impl<S> RefUnwindSafe for SolverRuntime<S>
impl<S> Send for SolverRuntime<S>
impl<S> Sync for SolverRuntime<S>
impl<S> Unpin for SolverRuntime<S>
impl<S> UnsafeUnpin for SolverRuntime<S>
impl<S> UnwindSafe for SolverRuntime<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
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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