[−][src]Struct cjdns_core::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]
forms: &[EncodingSchemeForm]
) -> Result<Self, SchemeValidationError>
Instantiates EncodingScheme
.
Returns an error if forms validation failed. See validate
function docs for more info.
pub fn validate(
forms: &[EncodingSchemeForm]
) -> Result<(), SchemeValidationError>
[src]
forms: &[EncodingSchemeForm]
) -> Result<(), SchemeValidationError>
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..32prefix_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]
fn clone(&self) -> EncodingScheme
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for EncodingScheme
[src]
impl Deref for EncodingScheme
[src]
type Target = [EncodingSchemeForm]
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl Eq for EncodingScheme
[src]
impl PartialEq<EncodingScheme> for EncodingScheme
[src]
fn eq(&self, other: &EncodingScheme) -> bool
[src]
fn ne(&self, other: &EncodingScheme) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,