Skip to main content

EncodableDataComponent

Trait EncodableDataComponent 

pub trait EncodableDataComponent:
    Send
    + Sync
    + Any
    + Debug {
    // Required methods
    fn encode(&self, buf: &mut Vec<u8>) -> Result<(), Error>;
    fn crc_hash(&self, registries: &RegistryHolder) -> Checksum;
    fn clone(&self) -> Box<dyn EncodableDataComponent>;
    fn eq(&self, other: &(dyn EncodableDataComponent + 'static)) -> bool;
}

Required Methods§

fn encode(&self, buf: &mut Vec<u8>) -> Result<(), Error>

fn crc_hash(&self, registries: &RegistryHolder) -> Checksum

fn clone(&self) -> Box<dyn EncodableDataComponent>

fn eq(&self, other: &(dyn EncodableDataComponent + 'static)) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl<T> EncodableDataComponent for T
where T: DataComponentTrait + Clone + AzBuf + PartialEq + Debug,