Trait rustc_metadata::rmeta::table::FixedSizeEncoding
source · pub(super) trait FixedSizeEncoding: Default {
type ByteArray;
fn from_bytes(b: &Self::ByteArray) -> Self;
fn write_to_bytes(self, b: &mut Self::ByteArray);
}
Expand description
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.