pub trait Entity:
Debug
+ Default
+ Clone {
type Builder: Builder;
const NAME: &'static str;
// Required methods
fn new_unchecked(data: Bytes) -> Self;
fn as_bytes(&self) -> Bytes;
fn as_slice(&self) -> &[u8] ⓘ;
fn from_slice(slice: &[u8]) -> Result<Self, VerificationError>;
fn from_compatible_slice(slice: &[u8]) -> Result<Self, VerificationError>;
fn new_builder() -> Self::Builder;
fn as_builder(self) -> Self::Builder;
}
Required Associated Constants§
Required Associated Types§
Required Methods§
fn new_unchecked(data: Bytes) -> Self
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[u8] ⓘ
fn from_slice(slice: &[u8]) -> Result<Self, VerificationError>
fn from_compatible_slice(slice: &[u8]) -> Result<Self, VerificationError>
fn new_builder() -> Self::Builder
fn as_builder(self) -> Self::Builder
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.