Skip to main content

ReplicatedComponent

Trait ReplicatedComponent 

Source
pub trait ReplicatedComponent: Component<Mutability = Mutable> {
    const COMPONENT_ID: u16;

    // Required methods
    fn fields() -> Vec<ReplicatedField>;
    fn read_fields(&self) -> Vec<FieldValue>;
    fn apply_field(&mut self, index: usize, value: FieldValue) -> Result<()>;
    fn from_fields(fields: &[FieldValue]) -> Result<Self>
       where Self: Sized;
}

Required Associated Constants§

Required Methods§

Source

fn fields() -> Vec<ReplicatedField>

Source

fn read_fields(&self) -> Vec<FieldValue>

Source

fn apply_field(&mut self, index: usize, value: FieldValue) -> Result<()>

Source

fn from_fields(fields: &[FieldValue]) -> Result<Self>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§