Struct shrev::EventHandler [] [src]

pub struct EventHandler { /* fields omitted */ }

Event handler for managing many separate event types.

Methods

impl EventHandler
[src]

[src]

Create a new EventHandler

[src]

Register an event type.

This will register the event type and allocate ringbuffer storage for the event type with a default max size of 200 events. Once the 200 mark is reached, and a reader has still not read the events, the buffer will overflow, and the reader will get an error on the next read.

[src]

Register an event type, with a given maximum number of events before overflowing.

This will register the event type and allocate ringbuffer storage for the event type with the given size. Once that size mark is reached, and a reader has still not read the events, the buffer will overflow, and the reader will get an error on the next read.

[src]

Register a reader of an event type.

To be able to read events, a reader id is required. This is because otherwise the handler wouldn't know where in the ringbuffer the reader has read to earlier. This information is stored in the reader id.

[src]

Write a number of events into its storage.

[src]

Write a single event into its storage.

[src]

Read any events that have been written to storage since the readers last read.