[][src]Struct cjdns_core::EncodingScheme

pub struct EncodingScheme(_);

Encoding scheme - an iterable list of scheme forms.

Schemes are comparable for equality, immutable, opaque and iterable.

Implementations

impl EncodingScheme[src]

pub fn try_new(
    forms: &[EncodingSchemeForm]
) -> Result<Self, SchemeValidationError>
[src]

Instantiates EncodingScheme.

Returns an error if forms validation failed. See validate function docs for more info.

pub fn validate(
    forms: &[EncodingSchemeForm]
) -> Result<(), SchemeValidationError>
[src]

Validates encoding scheme.

Returns an error in several situations:

  • provided forms slice length is 0 or greater than 31
  • bit_count value of any form is out of valid range - 1..32
  • prefix_len value of any form is out if valid range - 1..32 (for multiple forms scheme)
  • forms are not in ascending order by bits_count key
  • bits size of a form is greater than 59 (for multiple forms scheme)
  • forms with equal prefixes are in scheme

Each returned value fully reflects error type.

Trait Implementations

impl Clone for EncodingScheme[src]

impl Debug for EncodingScheme[src]

impl Deref for EncodingScheme[src]

type Target = [EncodingSchemeForm]

The resulting type after dereferencing.

impl Eq for EncodingScheme[src]

impl PartialEq<EncodingScheme> for EncodingScheme[src]

impl StructuralEq for EncodingScheme[src]

impl StructuralPartialEq for EncodingScheme[src]

Auto Trait Implementations

impl RefUnwindSafe for EncodingScheme

impl Send for EncodingScheme

impl Sync for EncodingScheme

impl Unpin for EncodingScheme

impl UnwindSafe for EncodingScheme

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.