Struct data_encoding::base::Spec [] [src]

pub struct Spec {
    pub val: &'static [(u8, u8)],
    pub pad: u8,
}

Specification implementation.

This implementation uses an array of inclusive ranges to easily describe symbol to value assocation. It is not meant for performance but for specification using the equal function.

Fields

val: &'static [(u8, u8)]

Symbol to value association.

This array defines inclusive ranges of symbols in value order. These ranges must not overlap. For instance, for &[(b'0', b'9'), (b'A', b'F')], b'0' has value 0, b'8' has value 8, and b'E' has value 14.

pad: u8

The padding.

Trait Implementations

impl Base for Spec
[src]

fn pad(&self) -> u8

Returns the padding.

fn val(&self, x: u8) -> Option<u8>

Returns the value of a symbol. Read more

fn bit(&self) -> usize

Returns the power of two of the base.

fn sym(&self, x: u8) -> u8

Returns the symbol of a value. Read more