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]

Create a new RcEventSource

Get an immutable reference of io

Get a mutable reference of io

Trait Implementations

impl<T> EventSourceTrait for RcEventSource<T> where
    T: EventSourceTrait
[src]

Register

Reregister

Deregister