pub struct SolverRuntime<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: PlanningSolution> SolverRuntime<S>
impl<S: PlanningSolution> SolverRuntime<S>
pub fn job_id(&self) -> usize
pub fn is_cancel_requested(&self) -> bool
pub fn emit_progress( &self, current_score: Option<S::Score>, best_score: Option<S::Score>, telemetry: SolverTelemetry, )
pub fn emit_best_solution( &self, solution: S, current_score: Option<S::Score>, best_score: S::Score, telemetry: SolverTelemetry, )
pub fn emit_completed( &self, solution: S, current_score: Option<S::Score>, best_score: S::Score, telemetry: SolverTelemetry, terminal_reason: SolverTerminalReason, )
pub fn emit_cancelled( &self, current_score: Option<S::Score>, best_score: Option<S::Score>, telemetry: SolverTelemetry, )
pub fn emit_failed(&self, error: String)
pub fn pause_with_snapshot( &self, solution: S, current_score: Option<S::Score>, best_score: Option<S::Score>, telemetry: SolverTelemetry, ) -> bool
Trait Implementations§
Source§impl<S: PlanningSolution> Clone for SolverRuntime<S>
impl<S: PlanningSolution> Clone for SolverRuntime<S>
Source§impl<S: PlanningSolution> Debug for SolverRuntime<S>
impl<S: PlanningSolution> Debug for SolverRuntime<S>
impl<S: PlanningSolution> Copy for SolverRuntime<S>
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