pub trait ReadUnchecked {
type HostType: Sized;
const SIZE: usize;
// Required method
unsafe fn read_unchecked<'a>(ctxt: &mut ReadCtxt<'a>) -> Self::HostType;
}Expand description
Read will always succeed if sufficient bytes are available.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourceunsafe fn read_unchecked<'a>(ctxt: &mut ReadCtxt<'a>) -> Self::HostType
unsafe fn read_unchecked<'a>(ctxt: &mut ReadCtxt<'a>) -> Self::HostType
Must read exactly SIZE bytes.
Unsafe as it avoids prohibitively expensive per-byte bounds checking.
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.