[−][src]Struct event_manager::EventManager
Allows event subscribers to be registered, connected to the event loop, and later removed.
Implementations
impl<S: MutEventSubscriber> EventManager<S>
[src]
pub fn new() -> Result<Self>
[src]
Create a new EventManger
object.
pub fn new_with_capacity(ready_events_capacity: usize) -> Result<Self>
[src]
Creates a new EventManger
object with specified event capacity.
Arguments
ready_events_capacity
: maximum number of ready events to be process in a single poll
pub fn run(&mut self) -> Result<usize>
[src]
Run the event loop blocking until events are triggered or an error is returned. Calls subscriber.process() for each event.
On success, it returns number of dispatched events or 0 when interrupted by a signal.
pub fn run_with_timeout(&mut self, milliseconds: i32) -> Result<usize>
[src]
Wait for events for a maximum timeout of miliseconds
or until an error is returned.
Calls subscriber.process() for each event.
On success, it returns number of dispatched events or 0 when interrupted by a signal.
Trait Implementations
impl<T: MutEventSubscriber> SubscriberOps for EventManager<T>
[src]
type Subscriber = T
Subscriber type for which the operations apply.
fn add_subscriber(&mut self, subscriber: T) -> SubscriberId
[src]
Register a subscriber with the event event_manager and returns the associated ID.
fn remove_subscriber(&mut self, subscriber_id: SubscriberId) -> Result<T>
[src]
Unregisters and returns the subscriber associated with the provided ID.
fn subscriber_mut(&mut self, subscriber_id: SubscriberId) -> Result<&mut T>
[src]
Return a mutable reference to the subscriber associated with the provided id.
fn event_ops(&mut self, subscriber_id: SubscriberId) -> Result<EventOps<'_>>
[src]
Returns a EventOps
object for the subscriber associated with the provided ID.
Auto Trait Implementations
impl<T> RefUnwindSafe for EventManager<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for EventManager<T> where
T: Send,
T: Send,
impl<T> Sync for EventManager<T> where
T: Sync,
T: Sync,
impl<T> Unpin for EventManager<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for EventManager<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,