[][src]Trait rtable::prefix::Prefixable

pub trait Prefixable {
    fn from_prefix(p: &Self) -> Self;
fn from_common(prefix1: &Self, prefix2: &Self) -> Self;
fn bytelen(&self) -> u8;
fn len(&self) -> u8;
fn octets(&self) -> &[u8];
fn octets_mut(&mut self) -> &mut [u8]; fn bit_at(&self, index: u8) -> u8 { ... }
fn contains(&self, prefix: &Self) -> bool { ... } }

Trait Prefixable.

Required methods

fn from_prefix(p: &Self) -> Self

Construct a prefix from given prefix.

fn from_common(prefix1: &Self, prefix2: &Self) -> Self

Construct a prefix from common parts of two prefixes.

fn bytelen(&self) -> u8

Return byte length of prefix.

fn len(&self) -> u8

Return prefix length.

fn octets(&self) -> &[u8]

Return reference of slice to address.

fn octets_mut(&mut self) -> &mut [u8]

Return mutable reference of slice to address.

Loading content...

Provided methods

fn bit_at(&self, index: u8) -> u8

Return 0 or 1 at certain position of bit in the prefix.

fn contains(&self, prefix: &Self) -> bool

Return true if given prefix is included in this prefix.

Loading content...

Implementors

impl<T: Addressable + Clone> Prefixable for Prefix<T>[src]

fn from_prefix(p: &Self) -> Self[src]

Construct a prefix from given prefix.

fn from_common(prefix1: &Self, prefix2: &Self) -> Self[src]

Construct a prefix from common parts of two prefixes, assuming p1 is shorter than p2.

fn len(&self) -> u8[src]

Return prefix length.

fn octets(&self) -> &[u8][src]

Return reference of slice to address.

fn octets_mut(&mut self) -> &mut [u8][src]

Return mutable reference of slice to address.

Loading content...