pub struct MessageKinds { /* private fields */ }Expand description
Registry mapping Message types to compact wire net-IDs and their deserializers.
Implementations§
Source§impl MessageKinds
impl MessageKinds
Sourcepub fn add_message<M: Message>(&mut self)
pub fn add_message<M: Message>(&mut self)
Registers message type M, assigning it the next sequential net-ID.
Sourcepub fn kind_bit_length(&self) -> u32
pub fn kind_bit_length(&self) -> u32
Bit width of every encoded MessageKind in this registry. Used by
derived Message::bit_length impls to size the kind-tag prefix.
Sourcepub fn read(
&self,
reader: &mut BitReader<'_>,
converter: &dyn LocalEntityAndGlobalEntityConverter,
) -> Result<MessageContainer, SerdeErr>
pub fn read( &self, reader: &mut BitReader<'_>, converter: &dyn LocalEntityAndGlobalEntityConverter, ) -> Result<MessageContainer, SerdeErr>
Reads a message kind tag then deserializes and returns the message payload from reader.
Trait Implementations§
Source§impl Clone for MessageKinds
impl Clone for MessageKinds
Auto Trait Implementations§
impl Freeze for MessageKinds
impl !RefUnwindSafe for MessageKinds
impl Send for MessageKinds
impl Sync for MessageKinds
impl Unpin for MessageKinds
impl UnsafeUnpin for MessageKinds
impl !UnwindSafe for MessageKinds
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more