Struct mioco::RcEventSource
[−]
[src]
pub struct RcEventSource<T>(_);
To share the data between coroutine itself and the coroutine internals
referring to the blocked event sources, RcEventSource
is being used.
Mioco event loop and coroutine itself never use the data in the same
time: either event loop or coroutine logic can be executing at the same
time. Technically this could use a pointer, but RefCell
is useful for
making sure no references are being kept when switching between these
two execution streams.
RcEventSource is parametrized over T
, but also implements
EventSourceTrait
to allow trait-object (dynamic-dispatch) access.
Methods
impl<T> RcEventSource<T>
[src]
fn new(t: T) -> Self
Create a new RcEventSource
fn io_ref(&self) -> Ref<T>
Get an immutable reference of io
fn io_mut(&self) -> RefMut<T>
Get a mutable reference of io
Trait Implementations
impl<T> EventSourceTrait for RcEventSource<T> where
T: EventSourceTrait,
[src]
T: EventSourceTrait,
fn register(
&mut self,
event_loop: &mut EventLoop<Handler>,
token: Token,
interest: EventSet
) -> bool
&mut self,
event_loop: &mut EventLoop<Handler>,
token: Token,
interest: EventSet
) -> bool
Register
fn reregister(
&mut self,
event_loop: &mut EventLoop<Handler>,
token: Token,
interest: EventSet
) -> bool
&mut self,
event_loop: &mut EventLoop<Handler>,
token: Token,
interest: EventSet
) -> bool
Reregister
fn deregister(&mut self, event_loop: &mut EventLoop<Handler>, token: Token)
Deregister