[−][src]Struct naia_shared::Manifest
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,