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

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.

Value to symbol association.

This array must have size 1 << b and defines sym(v) as sym[v].

The power of two of the base.

This value defines bit() as bit.

The padding.

This value defines pad() as pad.

Trait Implementations

impl<T> Base for Opt<T>
[src]

Returns the power of two of the base.

Returns the padding.

Returns the value of a symbol. Read more

Returns the symbol of a value. Read more