pub struct SizeRepr {
pub endianness: Endianness,
pub num_encoding: NumEncoding,
pub width: BitWidth,
pub max_size: usize,
}Expand description
Controls the binary representation of sizes.
Specifically, controls the Endianness, the NumEncoding, the BitWidth,
and the greatest encodable/decodable size before an error is thrown
Fields§
§endianness: Endianness§num_encoding: NumEncoding§width: BitWidth§max_size: usizeImplementations§
Source§impl SizeRepr
impl SizeRepr
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Returns the default size representation: little endian, fixed encoding, 64 bit width,
and the max size set to usize::MAX
Sourcepub const fn endianness(self, endiannes: Endianness) -> Self
pub const fn endianness(self, endiannes: Endianness) -> Self
Sets the endianness, then returns self.
Sourcepub const fn num_encoding(self, num_encoding: NumEncoding) -> Self
pub const fn num_encoding(self, num_encoding: NumEncoding) -> Self
Sets the numerical encoding, then returns self.
Trait Implementations§
impl Copy for SizeRepr
impl Eq for SizeRepr
impl StructuralPartialEq for SizeRepr
Auto Trait Implementations§
impl Freeze for SizeRepr
impl RefUnwindSafe for SizeRepr
impl Send for SizeRepr
impl Sync for SizeRepr
impl Unpin for SizeRepr
impl UnwindSafe for SizeRepr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more