Struct reactor::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>

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> RefUnwindSafe for Runtime<H, P>where H: RefUnwindSafe, P: RefUnwindSafe, <<H as Handler>::Listener as Resource>::Id: RefUnwindSafe, <<H as Handler>::Transport as Resource>::Id: RefUnwindSafe, <H as Handler>::Listener: RefUnwindSafe, <H as Handler>::Transport: RefUnwindSafe,

§

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

§

impl<H, P> Sync for Runtime<H, P>where H: Sync, P: Sync, <<H as Handler>::Listener as Resource>::Id: Sync, <<H as Handler>::Transport as Resource>::Id: Sync, <H as Handler>::Listener: Sync, <H as Handler>::Transport: Sync,

§

impl<H, P> Unpin for Runtime<H, P>where H: Unpin, P: Unpin, <H as Handler>::Command: Unpin, <<H as Handler>::Listener as Resource>::Id: Unpin, <<H as Handler>::Transport as Resource>::Id: Unpin, <H as Handler>::Listener: Unpin, <H as Handler>::Transport: Unpin,

§

impl<H, P> UnwindSafe for Runtime<H, P>where H: UnwindSafe, P: UnwindSafe, <<H as Handler>::Listener as Resource>::Id: UnwindSafe, <<H as Handler>::Transport as Resource>::Id: UnwindSafe, <H as Handler>::Listener: UnwindSafe, <H as Handler>::Transport: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.