[−][src]Struct naia_shared::Manifest
Contains the shared protocol between Client & Server, with a data that is able to map Event/Actor TypeIds to their representation within specified enums. Also is able to create new Event/Actors using registered Builders, given a specific TypeId.
Implementations
impl<T: EventType, U: ActorType> 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,
reader: &mut PacketReader<'_>
) -> Option<T>
[src]
&self,
naia_id: u16,
reader: &mut PacketReader<'_>
) -> Option<T>
Creates an Event instance, given a NaiaId and a payload, typically from an incoming packet
pub fn register_actor(&mut self, actor_builder: Box<dyn ActorBuilder<U>>)
[src]
Register an ActorBuilder to handle the creation of Actor instances
pub fn get_actor_naia_id(&self, type_id: &TypeId) -> u16
[src]
Given an Actor's TypeId, get a NaiaId (that can be written/read from packets)
pub fn create_actor(
&self,
naia_id: u16,
reader: &mut PacketReader<'_>
) -> Option<U>
[src]
&self,
naia_id: u16,
reader: &mut PacketReader<'_>
) -> Option<U>
Creates an Event instance, given a NaiaId and a payload, typically from an incoming packet
pub fn register_pawn(
&mut self,
actor_builder: Box<dyn ActorBuilder<U>>,
event_builder: Box<dyn EventBuilder<T>>
)
[src]
&mut self,
actor_builder: Box<dyn ActorBuilder<U>>,
event_builder: Box<dyn EventBuilder<T>>
)
Register both an ActorBuilder and an EventBuilder to handle the creation of both as a Pawn & Command, respectively. Pawns & Commands should be used for any player-controlled actor that requires clientside prediction
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,
pub 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.
pub 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.
pub 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>,