AiidEncodingConfig

Struct AiidEncodingConfig 

Source
pub struct AiidEncodingConfig {
    pub key_byte_count: usize,
    pub base_parity_byte_count: usize,
    pub cap_parity_byte_count: usize,
    pub prefix: Vec<u8>,
    pub prefix_cap: Vec<u8>,
    pub cap_segment_char_count: usize,
    pub encoded_char_count: usize,
}
Expand description

represents an encoding configuration for aiid rendering and parsing

Fields§

§key_byte_count: usize

byte count of actuall key data that will be encoded

§base_parity_byte_count: usize

parity bytes that will be encoded directly into the base32 string (appended after key)

§cap_parity_byte_count: usize

parity bytes that will be encoded in the alpha capitalization (appended after base parity)

§prefix: Vec<u8>

bytes to prefix before rendering to base32

§prefix_cap: Vec<u8>

binary indication of the capitalization for prefix characters

§cap_segment_char_count: usize

how many characters are in a capitalization parity segment

§encoded_char_count: usize

how many characters long the fully rendered base32 string should be

Implementations§

Source§

impl AiidEncodingConfig

Source

pub fn new(kind: &str) -> AiidResult<Self>

create a new config given a kind token string

§Example
let aia0 = aingle_id::AiidEncodingConfig::new("aia0").unwrap();
let aik0 = aingle_id::AiidEncodingConfig::new("aik0").unwrap();
let ais0 = aingle_id::AiidEncodingConfig::new("ais0").unwrap();

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.