Trait native_model::Model
source · pub trait Model: Sized {
// Required methods
fn native_model_id() -> u32;
fn native_model_id_str() -> &'static str;
fn native_model_version() -> u32;
fn native_model_version_str() -> &'static str;
fn native_model_decode_body(data: Vec<u8>, id: u32) -> DecodeResult<Self>
where Self: Sized;
fn native_model_decode_upgrade_body(
data: Vec<u8>,
id: u32,
version: u32
) -> Result<Self>
where Self: Sized;
fn native_model_encode_body(&self) -> EncodeResult<Vec<u8>>
where Self: Sized;
fn native_model_encode_downgrade_body(self, version: u32) -> Result<Vec<u8>>
where Self: Sized;
// Provided methods
fn native_model_decode(data: Vec<u8>) -> Result<(Self, u32)>
where Self: Sized { ... }
fn native_model_encode(&self) -> Result<Vec<u8>>
where Self: Sized { ... }
fn native_model_encode_downgrade(self, version: u32) -> Result<Vec<u8>>
where Self: Sized { ... }
}Required Methods§
fn native_model_id() -> u32
fn native_model_id_str() -> &'static str
fn native_model_version() -> u32
fn native_model_version_str() -> &'static str
fn native_model_decode_body(data: Vec<u8>, id: u32) -> DecodeResult<Self>where
Self: Sized,
fn native_model_decode_upgrade_body(
data: Vec<u8>,
id: u32,
version: u32
) -> Result<Self>where
Self: Sized,
fn native_model_encode_body(&self) -> EncodeResult<Vec<u8>>where
Self: Sized,
fn native_model_encode_downgrade_body(self, version: u32) -> Result<Vec<u8>>where
Self: Sized,
Provided Methods§
fn native_model_decode(data: Vec<u8>) -> Result<(Self, u32)>where
Self: Sized,
fn native_model_encode(&self) -> Result<Vec<u8>>where
Self: Sized,
fn native_model_encode_downgrade(self, version: u32) -> Result<Vec<u8>>where
Self: Sized,
Object Safety§
This trait is not object safe.