Struct Runtime

Source
pub struct Runtime<H: Handler, P: Poll> { /* private fields */ }
Expand description

Internal Reactor runtime which is run in a dedicated thread.

Use this structure direactly only if you’d like to have the full control over the reactor thread.

This runtime structure does not spawns a thread and is blocking. It implements the actual reactor event loop.

Implementations§

Source§

impl<H: Handler, P: Poll> Runtime<H, P>

Source

pub fn with(service: H, poller: P) -> Result<Self>

Creates new reactor runtime using provided Poll engine and a service exposing Handler API to the reactor.

Source

pub fn controller(&self) -> Controller<H::Command, <P::Waker as Waker>::Send>

Provides a copy of a Controller object which exposes an API to the reactor and a service running inside of its thread.

See Handler::Command for the details.

Auto Trait Implementations§

§

impl<H, P> Freeze for Runtime<H, P>
where H: Freeze, P: Freeze, <<P as Poll>::Waker as Waker>::Recv: Freeze, <<P as Poll>::Waker as Waker>::Send: Freeze,

§

impl<H, P> RefUnwindSafe for Runtime<H, P>

§

impl<H, P> Send for Runtime<H, P>

§

impl<H, P> Sync for Runtime<H, P>
where H: Sync, P: Sync, <<P as Poll>::Waker as Waker>::Recv: Sync, <H as Handler>::Listener: Sync, <H as Handler>::Transport: Sync,

§

impl<H, P> Unpin for Runtime<H, P>
where H: Unpin, P: Unpin, <<P as Poll>::Waker as Waker>::Recv: Unpin, <<P as Poll>::Waker as Waker>::Send: Unpin, <H as Handler>::Command: Unpin, <H as Handler>::Listener: Unpin, <H as Handler>::Transport: Unpin,

§

impl<H, P> UnwindSafe for Runtime<H, P>

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.