[][src]Struct naia_shared::EventManager

pub struct EventManager<T: EventType> { /* fields omitted */ }

Handles incoming/outgoing events, tracks the delivery status of Events so that guaranteed Events can be re-transmitted to the remote host

Implementations

impl<T: EventType> EventManager<T>[src]

pub fn new() -> Self[src]

Creates a new EventManager

pub fn notify_packet_delivered(&mut self, packet_index: u16)[src]

Occurs when a packet has been notified as delivered. Stops tracking the status of Events in that packet.

pub fn notify_packet_dropped(&mut self, packet_index: u16)[src]

Occurs when a packet has been notified as having been dropped. Queues up any guaranteed Events that were lost in the packet for retransmission.

pub fn has_outgoing_events(&self) -> bool[src]

Returns whether the Manager has queued Events that can be transmitted to the remote host

pub fn pop_outgoing_event(
    &mut self,
    packet_index: u16
) -> Option<Rc<Box<dyn Event<T>>>>
[src]

Gets the next queued Event to be transmitted

pub fn unpop_outgoing_event(
    &mut self,
    packet_index: u16,
    event: &Rc<Box<dyn Event<T>>>
)
[src]

If the last popped Event from the queue somehow wasn't able to be written into a packet, put the Event back into the front of the queue

pub fn queue_outgoing_event(&mut self, event: &impl Event<T>)[src]

Queues an Event to be transmitted to the remote host

pub fn has_incoming_events(&self) -> bool[src]

Returns whether any Events have been received that must be handed to the application

pub fn pop_incoming_event(&mut self) -> Option<T>[src]

Get the most recently received Event

pub fn process_data<U: EntityType>(
    &mut self,
    reader: &mut PacketReader,
    manifest: &Manifest<T, U>
)
[src]

Given incoming packet data, read transmitted Events and store them to be returned to the application

Trait Implementations

impl<T: Debug + EventType> Debug for EventManager<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for EventManager<T>

impl<T> !Send for EventManager<T>

impl<T> !Sync for EventManager<T>

impl<T> Unpin for EventManager<T> where
    T: Unpin

impl<T> !UnwindSafe for EventManager<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.