pub struct Runner { /* private fields */ }Expand description
Hosts an Executor on a dedicated thread.
Implementations§
Source§impl Runner
impl Runner
Sourcepub fn new(exec: Executor, flags: RunnerFlags) -> Result<Self, ExecutorError>
pub fn new(exec: Executor, flags: RunnerFlags) -> Result<Self, ExecutorError>
Spawn a runner thread; returns immediately. If flags.DEFERRED is set
the run loop blocks until Runner::start is invoked.
§Panics
Panics if the internal error-capture mutex is poisoned, which can only happen if a previous holder panicked while holding it — an event that is not expected under normal use.
Sourcepub fn start(&mut self) -> Result<(), ExecutorError>
pub fn start(&mut self) -> Result<(), ExecutorError>
Resume a deferred runner. No-op if the runner was not deferred.
Sourcepub fn stop(&mut self) -> Result<(), ExecutorError>
pub fn stop(&mut self) -> Result<(), ExecutorError>
Stop the runner and re-throw any captured item error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Runner
impl !RefUnwindSafe for Runner
impl Send for Runner
impl !Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
impl !UnwindSafe for Runner
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