pub enum Payload {
Origin(RouteOrigin),
RouterKey(RouterKey),
}
Expand description
All payload types supported by RTR and this crate.
Variants
Origin(RouteOrigin)
A route origin authorisation.
RouterKey(RouterKey)
A BGPsec router key.
Implementations
sourceimpl Payload
impl Payload
sourcepub fn origin(prefix: MaxLenPrefix, asn: Asn) -> Self
pub fn origin(prefix: MaxLenPrefix, asn: Asn) -> Self
Creates a new prefix origin payload.
sourcepub fn router_key(
key_identifier: KeyIdentifier,
asn: Asn,
key_info: RouterKeyInfo
) -> Self
pub fn router_key(
key_identifier: KeyIdentifier,
asn: Asn,
key_info: RouterKeyInfo
) -> Self
Creates a new router key payload.
sourcepub fn to_origin(&self) -> Option<RouteOrigin>
pub fn to_origin(&self) -> Option<RouteOrigin>
Returns the origin prefix if the value is of the origin variant.
sourcepub fn as_router_key(&self) -> Option<&RouterKey>
pub fn as_router_key(&self) -> Option<&RouterKey>
Returns the router key if the value is of the router key variant.
Trait Implementations
sourceimpl From<RouteOrigin> for Payload
impl From<RouteOrigin> for Payload
sourcefn from(src: RouteOrigin) -> Self
fn from(src: RouteOrigin) -> Self
Performs the conversion.
sourceimpl Ord for Payload
impl Ord for Payload
sourceimpl PartialOrd<Payload> for Payload
impl PartialOrd<Payload> for Payload
sourcefn partial_cmp(&self, other: &Payload) -> Option<Ordering>
fn partial_cmp(&self, other: &Payload) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Payload
impl StructuralEq for Payload
impl StructuralPartialEq for Payload
Auto Trait Implementations
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more