[][src]Struct routinator::origins::OriginsDiff

pub struct OriginsDiff { /* fields omitted */ }

The difference between two address origin lists.

A value of this types keeps two lists. One lists, announce contains the address origins added in this diff, the second, withdraw those that were removed. In addition, the serial field holds a serial number for this diff.

You can create a diff via the construct method from a set of address origins, route origins, and exceptions.

Methods

impl OriginsDiff[src]

pub fn empty(serial: Serial) -> Self[src]

Creates an empty origins diff with the given serial number.

Both the announce and withdraw lists will be empty.

pub fn is_empty(&self) -> bool[src]

Returns whether this is an empty diff.

A diff is empty if both the accounce and withdraw lists are empty.

pub fn construct(
    current: HashSet<AddressOrigin>,
    origins: Vec<RouteOrigins>,
    exceptions: &LocalExceptions,
    serial: Serial,
    extra_info: bool,
    metrics: &mut Metrics
) -> (AddressOrigins, Self)
[src]

Constructs a diff.

The method takes the previous list of address origins as a set (so that there are definitely no duplicates), a list of route origins gained from validation, a list of local exceptions, and the serial number of the current version.

It will create and return the new list of address origins from the route origins and a origins diff between the new and old address origins with the serial number of serial plus one.

pub fn serial(&self) -> Serial[src]

Returns the serial number of this origins diff.

pub fn announce(&self) -> &[AddressOrigin][src]

Returns a slice with the address origins added by this diff.

pub fn withdraw(&self) -> &[AddressOrigin][src]

Returns a slice with the address origins removed by this diff.

pub fn unwrap(self) -> (Serial, Vec<AddressOrigin>, Vec<AddressOrigin>)[src]

Unwraps the diff into the serial number, announce and withdraw lists.

Trait Implementations

impl Clone for OriginsDiff[src]

impl Debug for OriginsDiff[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for 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 = !

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.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

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

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