Trait rustc_metadata::rmeta::table::FixedSizeEncoding [−][src]
Helper trait, for encoding to, and decoding from, a fixed number of bytes.
Used mainly for Lazy positions and lengths.
Unchecked invariant: Self::default() should encode as [0; BYTE_LEN],
but this has no impact on safety.
Associated Constants
Loading content...Required methods
fn from_bytes(b: &[u8]) -> Self[src]
fn write_to_bytes(self, b: &mut [u8])[src]
fn maybe_read_from_bytes_at(b: &[u8], i: usize) -> Option<Self>[src]
Read a Self value (encoded as Self::BYTE_LEN bytes),
from &b[i * Self::BYTE_LEN..], returning None if i
is not in bounds, or Some(Self::from_bytes(...)) otherwise.
fn write_to_bytes_at(self, b: &mut [u8], i: usize)[src]
Write a Self value (encoded as Self::BYTE_LEN bytes),
at &mut b[i * Self::BYTE_LEN..], using Self::write_to_bytes.