pub struct Format {
pub store: StoreFormat,
pub order: OrderFormat,
}
Expand description
A description of the format used to SCALE encode some bits.
Fields§
§store: StoreFormat
The StoreFormat
defines the size of each chunk that’s written (eg u8, u16 etc).
order: OrderFormat
The OrderFormat
determines the order in which we write bits to the store type;
do we write to the least significant bit first and work up, or write to the most
significant byte first and work down.
Implementations§
Source§impl Format
impl Format
Sourcepub fn new(store: StoreFormat, order: OrderFormat) -> Self
pub fn new(store: StoreFormat, order: OrderFormat) -> Self
Define a new format by providing a store and order.
§Example
use scale_bits::scale::format::{ Format, StoreFormat, OrderFormat };
let format = Format::new(StoreFormat::U8, OrderFormat::Lsb0);
Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnwindSafe for Format
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