pub struct Runner<A> { /* private fields */ }Expand description
Configurable executor for one reconstruction algorithm.
A runner owns the algorithm, run options, callbacks, optional checkpoint, and optional
backend. Self::run consumes the runner and borrows a validated problem.
Implementations§
Source§impl<A: ReconstructionAlgorithm> Runner<A>
impl<A: ReconstructionAlgorithm> Runner<A>
Sourcepub fn new(algorithm: A, options: RunOptions) -> Self
pub fn new(algorithm: A, options: RunOptions) -> Self
Creates a runner from an algorithm and algorithm-independent options.
Sourcepub fn with_callback(self, callback: Box<dyn Callback>) -> Self
pub fn with_callback(self, callback: Box<dyn Callback>) -> Self
Appends one callback in invocation order.
Sourcepub fn with_callbacks(self, callbacks: Vec<Box<dyn Callback>>) -> Self
pub fn with_callbacks(self, callbacks: Vec<Box<dyn Callback>>) -> Self
Appends callbacks in their vector order.
Sourcepub fn resume_from(self, checkpoint: ReconstructionCheckpoint) -> Self
pub fn resume_from(self, checkpoint: ReconstructionCheckpoint) -> Self
Sets a validated checkpoint from which state and elapsed trace are restored.
Sourcepub fn with_backend(self, backend: Arc<dyn Backend>) -> Self
pub fn with_backend(self, backend: Arc<dyn Backend>) -> Self
Selects an execution backend used to initialize or restore state.
Sourcepub fn run<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
) -> Result<ReconstructionResult>
pub fn run<M: MeasurementRead>( self, problem: &ReconstructionProblem<M>, ) -> Result<ReconstructionResult>
Validates inputs, executes scheduled batches and callbacks, and returns owned results.
The run stops at max_iterations or when a callback returns a stop action. A supplied
checkpoint must match the problem and the algorithm’s required auxiliary state.
Auto Trait Implementations§
impl<A> Freeze for Runner<A>where
A: Freeze,
impl<A> !RefUnwindSafe for Runner<A>
impl<A> Send for Runner<A>where
A: Send,
impl<A> !Sync for Runner<A>
impl<A> Unpin for Runner<A>where
A: Unpin,
impl<A> UnsafeUnpin for Runner<A>where
A: UnsafeUnpin,
impl<A> !UnwindSafe for Runner<A>
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> 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