[−][src]Struct cjdns_core::EncodingSchemeForm
A form of an encoding scheme. Form is used as follows to encode a director:
[ director ] [ form.prefix ]
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
form.bit_count bits form.prefix_len bits
Implementations
impl EncodingSchemeForm
[src]
pub fn try_new(
bit_count: u8,
prefix_len: u8,
prefix: u32
) -> Result<Self, FormValidationError>
[src]
bit_count: u8,
prefix_len: u8,
prefix: u32
) -> Result<Self, FormValidationError>
Instantiates EncodingSchemeForm
.
Returns an error in several situations:
- encoding
bit_count
value is out of valid range, which is 1..32 prefix_len
is too small for the providedprefix
pub fn params(&self) -> (u8, u8, u32)
[src]
Returns encoding scheme form params in respected order:
- bit count;
- prefix length;
- prefix itself.
pub fn size_bits(&self) -> u8
[src]
As a scheme is represented as an array of forms, this function will tell you how many bits of label space is occupied by a representation of a given form.
Trait Implementations
impl Clone for EncodingSchemeForm
[src]
fn clone(&self) -> EncodingSchemeForm
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for EncodingSchemeForm
[src]
impl Debug for EncodingSchemeForm
[src]
impl Eq for EncodingSchemeForm
[src]
impl Ord for EncodingSchemeForm
[src]
fn cmp(&self, other: &EncodingSchemeForm) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<EncodingSchemeForm> for EncodingSchemeForm
[src]
fn eq(&self, other: &EncodingSchemeForm) -> bool
[src]
fn ne(&self, other: &EncodingSchemeForm) -> bool
[src]
impl PartialOrd<EncodingSchemeForm> for EncodingSchemeForm
[src]
fn partial_cmp(&self, other: &EncodingSchemeForm) -> Option<Ordering>
[src]
fn lt(&self, other: &EncodingSchemeForm) -> bool
[src]
fn le(&self, other: &EncodingSchemeForm) -> bool
[src]
fn gt(&self, other: &EncodingSchemeForm) -> bool
[src]
fn ge(&self, other: &EncodingSchemeForm) -> bool
[src]
impl StructuralEq for EncodingSchemeForm
[src]
impl StructuralPartialEq for EncodingSchemeForm
[src]
Auto Trait Implementations
impl RefUnwindSafe for EncodingSchemeForm
impl Send for EncodingSchemeForm
impl Sync for EncodingSchemeForm
impl Unpin for EncodingSchemeForm
impl UnwindSafe for EncodingSchemeForm
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>,