pub struct Reactor { /* private fields */ }Expand description
High-level reactor API wrapping reactor Runtime into a thread and providing basic thread
management for it.
Apps running the Reactor can interface it and a ReactionHandler via use of the Controller
API.
Implementations§
Source§impl Reactor
impl Reactor
Sourcepub fn new<H>(service: H, thread_name: String) -> Result<Self, Error>where
H: 'static + ReactionHandler,
pub fn new<H>(service: H, thread_name: String) -> Result<Self, Error>where
H: 'static + ReactionHandler,
Creates new reactor and a service exposing the ReactionHandler to
the reactor.
The service is sent to the newly created reactor thread which runs the
reactor Runtime.
Sourcepub fn controller(&self) -> Controller
pub fn controller(&self) -> Controller
Provides a Controller that can be used to send events to
ReactionHandler via self.
Auto Trait Implementations§
impl Freeze for Reactor
impl !RefUnwindSafe for Reactor
impl Send for Reactor
impl Sync for Reactor
impl Unpin for Reactor
impl UnsafeUnpin for Reactor
impl !UnwindSafe for Reactor
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
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>
Converts
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>
Converts
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