Struct data_encoding::base::Opt
[−]
[src]
pub struct Opt<T> { pub val: &'static [u8], pub sym: &'static [u8], pub bit: u8, pub pad: u8, pub _phantom: PhantomData<T>, }
Optimized implementation.
This implementation uses static arrays for constant-time lookup. It also uses a phantom type to enable static dispatch on demand.
Fields
val: &'static [u8]
Symbol to value association.
This array must have size 256 and defines val(s)
as
Some(val[s])
if val[s] < 128
and None
otherwise.
sym: &'static [u8]
Value to symbol association.
This array must have size 1 << b
and defines sym(v)
as
sym[v]
.
bit: u8
The power of two of the base.
This value defines bit()
as bit
.
pad: u8
The padding.
This value defines pad()
as pad
.
_phantom: PhantomData<T>