pub struct EventManager<T> { /* private fields */ }
Expand description

Allows event subscribers to be registered, connected to the event loop, and later removed.

Implementations

Create a new EventManger object.

Creates a new EventManger object with specified event capacity.

Arguments
  • ready_events_capacity: maximum number of ready events to be processed a single run. The maximum value of this parameter is EventManager::MAX_READY_EVENTS_CAPACITY.

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.

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

Register a subscriber with the event event_manager and returns the associated ID.

Unregisters and returns the subscriber associated with the provided ID.

Return a mutable reference to the subscriber associated with the provided id.

Returns a EventOps object for the subscriber associated with the provided ID.

Subscriber type for which the operations apply.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.