[][src]Struct naia_shared::StateMask

pub struct StateMask { /* fields omitted */ }

The State Mask is a variable-length byte array, where each bit represents the current state of a Property owned by an Actor. The Property state tracked is whether it has been updated and needs to be synced with the remote Client

Implementations

impl StateMask[src]

pub fn new(bytes: u8) -> StateMask[src]

Create a new StateMask with a given number of bytes

pub fn get_bit(&self, index: u8) -> Option<bool>[src]

Gets the bit at the specified position within the StateMask

pub fn set_bit(&mut self, index: u8, value: bool)[src]

Sets the bit at the specified position within the StateMask

pub fn clear(&mut self)[src]

Clears the whole StateMask

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

Returns whether any bit has been set in the StateMask

pub fn byte_number(&self) -> u8[src]

Get the number of bytes required to represent the StateMask

pub fn get_byte(&self, index: usize) -> u8[src]

Gets a byte at the specified index in the StateMask

pub fn nand(&mut self, other: &StateMask)[src]

Performs a NAND operation on the StateMask, with another StateMask

pub fn or(&mut self, other: &StateMask)[src]

Performs an OR operation on the StateMask, with another StateMask

pub fn write(&mut self, out_bytes: &mut Vec<u8>)[src]

Writes the StateMask into an outgoing byte stream

pub fn read(reader: &mut PacketReader<'_>) -> StateMask[src]

Reads the StateMask from an incoming packet

pub fn copy_contents(&mut self, other: &StateMask)[src]

Copies the StateMask into another StateMask

Trait Implementations

impl Clone for StateMask[src]

impl Debug for StateMask[src]

impl Display for StateMask[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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>,