[][src]Struct naia_shared::Property

pub struct Property<T: Clone + DeBin + SerBin + PartialEq> { /* fields omitted */ }

A Property of an Actor, that contains data which must be tracked for updates, and synced to the Client

Implementations

impl<T: Clone + DeBin + SerBin + PartialEq> Property<T>[src]

pub fn new(value: T, index: u8) -> Property<T>[src]

Create a new Property

pub fn get(&self) -> &T[src]

Gets a reference to the value contained by the Property

pub fn set(&mut self, value: T)[src]

Set the Property's contained value

pub fn set_mutator(&mut self, mutator: &Rc<RefCell<dyn ActorMutator>>)[src]

Set an ActorMutator object to track changes to the Property

pub fn equals(&self, other: &Property<T>) -> bool[src]

Compare to another property

pub fn mirror(&mut self, other: &Property<T>)[src]

Set value to the value of another Property

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

Writes contained value into outgoing byte stream

pub fn read(&mut self, reader: &mut PacketReader<'_>, packet_index: u16)[src]

Given a cursor into incoming packet data, updates the Property with the synced value, but only if data is newer than the last data received

Trait Implementations

impl<T: Clone + DeBin + SerBin + PartialEq> Clone for Property<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Property<T>

impl<T> !Send for Property<T>

impl<T> !Sync for Property<T>

impl<T> Unpin for Property<T> where
    T: Unpin

impl<T> !UnwindSafe for Property<T>

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