pub trait Reader<'r>:
Sized
+ Debug
+ Clone
+ Copy {
type Entity: Entity;
const NAME: &'static str;
// Required methods
fn verify(slice: &[u8], compatible: bool) -> Result<(), VerificationError>;
fn new_unchecked(slice: &'r [u8]) -> Self;
fn as_slice(&self) -> &'r [u8] ⓘ;
fn to_entity(&self) -> Self::Entity;
// Provided methods
fn from_slice(slice: &'r [u8]) -> Result<Self, VerificationError> { ... }
fn from_compatible_slice(slice: &'r [u8]) -> Result<Self, VerificationError> { ... }
}
Required Associated Constants§
Required Associated Types§
Required Methods§
fn verify(slice: &[u8], compatible: bool) -> Result<(), VerificationError>
fn new_unchecked(slice: &'r [u8]) -> Self
fn as_slice(&self) -> &'r [u8] ⓘ
fn to_entity(&self) -> Self::Entity
Provided Methods§
fn from_slice(slice: &'r [u8]) -> Result<Self, VerificationError>
fn from_compatible_slice(slice: &'r [u8]) -> Result<Self, VerificationError>
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.