pub trait Event:
Sealed
+ Debug
+ Serialize
+ DeserializeOwned
+ 'static {
const TYPE_CODE: TypeCode;
const SCHEMA_VERSION: u32;
// Provided methods
fn canonical_bytes(&self) -> Vec<u8> ⓘ
where Self: Sized { ... }
fn from_bytes(
version: u32,
bytes: &[u8],
) -> Result<Box<Self>, DeserializeError>
where Self: Sized { ... }
fn approx_size(&self) -> usize
where Self: Sized { ... }
}Expand description
Event — derive-only via #[derive(arkhe_macros::ArkheEvent)]. Same
postcard-default shape as Component; user types must additionally
#[derive(Debug, serde::Serialize, serde::Deserialize)].
Required Associated Constants§
Sourceconst SCHEMA_VERSION: u32
const SCHEMA_VERSION: u32
Version tag for canonical bytes.
Provided Methods§
Sourcefn from_bytes(version: u32, bytes: &[u8]) -> Result<Box<Self>, DeserializeError>where
Self: Sized,
fn from_bytes(version: u32, bytes: &[u8]) -> Result<Box<Self>, DeserializeError>where
Self: Sized,
Inverse of canonical_bytes.
Sourcefn approx_size(&self) -> usizewhere
Self: Sized,
fn approx_size(&self) -> usizewhere
Self: Sized,
Approximate byte size — defaults to encoded length.
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.