[][src]Struct naia_shared::PacketWriter

pub struct PacketWriter {
    pub entity_working_bytes: Vec<u8>,
    pub entity_message_count: u8,
    // some fields omitted
}

Handles writing of Event & Entity data into an outgoing packet

Fields

entity_working_bytes: Vec<u8>

bytes representing outgoing Entity messages / updates

entity_message_count: u8

number of Entity messages to be written

Implementations

impl PacketWriter[src]

pub fn new() -> PacketWriter[src]

Construct a new instance of PacketReader, the given buffer will be used to read information from.

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

Returns whether the writer has bytes to write into the outgoing packet

pub fn get_bytes(&mut self) -> Box<[u8]>[src]

Gets the bytes to write into an outgoing packet

pub fn bytes_number(&self) -> usize[src]

Get the number of bytes which is ready to be written into an outgoing packet

pub fn write_event<T: EventType, U: EntityType>(
    &mut self,
    manifest: &Manifest<T, U>,
    event: &Box<dyn Event<T>>
) -> bool
[src]

Writes an Event into the Writer's internal buffer, which will eventually be put into the outgoing packet

Auto Trait Implementations

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>,