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 Types§
Required Associated Constants§
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>
Object Safety§
This trait is not object safe.