[−][src]Struct routinator::origins::OriginsDiff
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]
current: HashSet<AddressOrigin>,
origins: Vec<RouteOrigins>,
exceptions: &LocalExceptions,
serial: Serial,
extra_info: bool,
metrics: &mut Metrics
) -> (AddressOrigins, Self)
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]
fn clone(&self) -> OriginsDiff
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for OriginsDiff
[src]
Auto Trait Implementations
impl Send for OriginsDiff
impl Sync for OriginsDiff
impl Unpin for OriginsDiff
impl UnwindSafe for OriginsDiff
impl RefUnwindSafe for OriginsDiff
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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 = !
The type returned in the event of a conversion error.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,