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
sourceimpl<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) -> Self
pub fn new_read(reader: &mut BitReader<'_>, mutator_index: u8) -> Self
Given a cursor into incoming packet data, initializes the Property with the synced value
sourcepub fn read_write(bit_reader: &mut BitReader<'_>, bit_writer: &mut BitWriter)
pub fn read_write(bit_reader: &mut BitReader<'_>, bit_writer: &mut BitWriter)
Reads from a stream and immediately writes to a stream Used to buffer updates for later
sourcepub fn read(&mut self, reader: &mut BitReader<'_>)
pub fn read(&mut self, reader: &mut BitReader<'_>)
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
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Property<T>
impl<T> Send for Property<T> where
T: Send,
impl<T> Sync for Property<T> where
T: Sync,
impl<T> Unpin for Property<T> where
T: Unpin,
impl<T> !UnwindSafe for Property<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more