Struct naia_shared::Property
source · pub struct Property<T: Serde> { /* private fields */ }Expand description
A Property of an Component/Message, that contains data which must be tracked for updates
Implementations§
source§impl<T: Serde> Property<T>
impl<T: Serde> Property<T>
sourcepub fn mirror(&mut self, other: &Property<T>)
pub fn mirror(&mut self, other: &Property<T>)
Set value to the value of another Property, queues for update if value changes
sourcepub fn write(&self, writer: &mut dyn BitWrite)
pub fn write(&self, writer: &mut dyn BitWrite)
Writes contained value into outgoing byte stream
sourcepub fn new_read(
reader: &mut BitReader<'_>,
mutator_index: u8
) -> Result<Self, SerdeErr>
pub fn new_read( reader: &mut BitReader<'_>, mutator_index: u8 ) -> Result<Self, SerdeErr>
Given a cursor into incoming packet data, initializes the Property with the synced value
sourcepub fn read_write(
reader: &mut BitReader<'_>,
writer: &mut BitWriter
) -> Result<(), SerdeErr>
pub fn read_write( reader: &mut BitReader<'_>, writer: &mut BitWriter ) -> Result<(), SerdeErr>
Reads from a stream and immediately writes to a stream Used to buffer updates for later
sourcepub fn read(&mut self, reader: &mut BitReader<'_>) -> Result<(), SerdeErr>
pub fn read(&mut self, reader: &mut BitReader<'_>) -> Result<(), SerdeErr>
Given a cursor into incoming packet data, updates the Property with the synced value
sourcepub fn set_mutator(&mut self, mutator: &PropertyMutator)
pub fn set_mutator(&mut self, mutator: &PropertyMutator)
Set an PropertyMutator to track changes to the Property