[][src]Struct naia_shared::Manifest

pub struct Manifest<T: EventType, U: EntityType> { /* fields omitted */ }

Contains the shared protocol between Client & Server, with a data that is able to map Event/Entity TypeIds to their representation within specified enums. Also is able to create new Event/Entities using registered Builders, given a specific TypeId.

Implementations

impl<T: EventType, U: EntityType> Manifest<T, U>[src]

pub fn new() -> Self[src]

Create a new Manifest

pub fn register_event(&mut self, event_builder: Box<dyn EventBuilder<T>>)[src]

Register an EventBuilder to handle the creation of Event instances

pub fn get_event_naia_id(&self, type_id: &TypeId) -> u16[src]

Given an Event's TypeId, get a NaiaId (that can be written/read from packets)

pub fn create_event(&self, naia_id: u16, bytes: &[u8]) -> Option<T>[src]

Creates an Event instance, given a NaiaId and a payload, typically from an incoming packet

pub fn register_entity(&mut self, entity_builder: Box<dyn EntityBuilder<U>>)[src]

Register an EntityBuilder to handle the creation of Entity instances

pub fn get_entity_naia_id(&self, type_id: &TypeId) -> u16[src]

Given an Entity's TypeId, get a NaiaId (that can be written/read from packets)

pub fn create_entity(&self, naia_id: u16, bytes: &[u8]) -> Option<U>[src]

Creates an Event instance, given a NaiaId and a payload, typically from an incoming packet

Trait Implementations

impl<T: Debug + EventType, U: Debug + EntityType> Debug for Manifest<T, U>[src]

Auto Trait Implementations

impl<T, U> !RefUnwindSafe for Manifest<T, U>

impl<T, U> !Send for Manifest<T, U>

impl<T, U> !Sync for Manifest<T, U>

impl<T, U> Unpin for Manifest<T, U>

impl<T, U> !UnwindSafe for Manifest<T, U>

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,