1//! States of a [`Solver`].
2use std::fmt::Display;
34use crate::stats::SolverStats;
56use super::private::Internal;
7use super::private::Sealed;
8use super::SearchStatus;
9use super::Solver;
10use super::SolverError;
1112pub trait SolverState: Sealed {}
1314impl Sealed for Init {}
15impl Sealed for ModelLoaded {}
16impl Sealed for ExecutionSuccess {}
17impl Sealed for ExecutionFailure {}
1819impl SolverState for Init {}
20impl SolverState for ModelLoaded {}
21impl SolverState for ExecutionSuccess {}
22impl SolverState for ExecutionFailure {}
2324pub struct Init;
25pub struct ModelLoaded;
2627/// The state returned by [`Solver`] if solving has been successful.
28pub struct ExecutionSuccess {
29/// Execution statistics.
30pub stats: SolverStats,
3132/// The status of the search
33pub status: SearchStatus,
3435/// Cannot construct this from outside this module.
36pub _sealed: Internal,
37}
3839/// The state returned by [`Solver`] if solving has not been successful.
40pub struct ExecutionFailure {
41pub why: SolverError,
4243/// Cannot construct this from outside this module.
44pub _sealed: Internal,
45}