Struct amethyst::shrev::EventChannel[]

pub struct EventChannel<E> { /* fields omitted */ }

Event channel

Methods

impl<E> EventChannel<E> where
    E: Event

Create a new EventChannel with a default size of 50

Create a new EventChannel with the given starting capacity.

Register a reader.

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

Deprecated

: please use iter_write instead

Write a slice of events into storage

Write an iterator of events into storage

Drain a vector of events into storage.

Write a single event into storage.

Important traits for StorageIterator<'a, T>

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

Trait Implementations

impl<E> Default for EventChannel<E> where
    E: Event

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl<E> Send for EventChannel<E> where
    E: Send

impl<E> Sync for EventChannel<E> where
    E: Sync