Skip to main content

Runner

Struct Runner 

Source
pub struct Runner { /* private fields */ }
Expand description

Hosts an Executor on a dedicated thread.

Implementations§

Source§

impl Runner

Source

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.

Source

pub fn start(&mut self) -> Result<(), ExecutorError>

Resume a deferred runner. No-op if the runner was not deferred.

Source

pub fn stop(&mut self) -> Result<(), ExecutorError>

Stop the runner and re-throw any captured item error.

Source

pub fn stoppable(&self) -> Stoppable

Get a Stoppable for sharing into other threads.

Trait Implementations§

Source§

impl Drop for Runner

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.