pub struct FlowSpecRule {
pub components: Vec<FlowSpecComponent>,
}Expand description
A complete FlowSpec NLRI rule — an ordered set of match components.
Components must be sorted by ascending type code. A rule may contain at most one component of each type.
Fields§
§components: Vec<FlowSpecComponent>Ordered match components (ascending type code).
Implementations§
Source§impl FlowSpecRule
impl FlowSpecRule
Sourcepub fn validate(&self) -> Result<(), DecodeError>
pub fn validate(&self) -> Result<(), DecodeError>
Validate that components are in ascending type-code order.
§Errors
Returns DecodeError if the rule has no components or if components
are not in strictly ascending type-code order.
Sourcepub fn display_string(&self) -> String
pub fn display_string(&self) -> String
Return a human-readable display string for logging / gRPC.
Sourcepub fn destination_prefix(&self) -> Option<Prefix>
pub fn destination_prefix(&self) -> Option<Prefix>
Extract the destination prefix from the rule, if present.
Trait Implementations§
Source§impl Clone for FlowSpecRule
impl Clone for FlowSpecRule
Source§fn clone(&self) -> FlowSpecRule
fn clone(&self) -> FlowSpecRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlowSpecRule
impl Debug for FlowSpecRule
Source§impl Display for FlowSpecRule
impl Display for FlowSpecRule
Source§impl Hash for FlowSpecRule
impl Hash for FlowSpecRule
Source§impl Ord for FlowSpecRule
impl Ord for FlowSpecRule
Source§fn cmp(&self, other: &FlowSpecRule) -> Ordering
fn cmp(&self, other: &FlowSpecRule) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FlowSpecRule
impl PartialEq for FlowSpecRule
Source§impl PartialOrd for FlowSpecRule
impl PartialOrd for FlowSpecRule
impl Eq for FlowSpecRule
impl StructuralPartialEq for FlowSpecRule
Auto Trait Implementations§
impl Freeze for FlowSpecRule
impl RefUnwindSafe for FlowSpecRule
impl Send for FlowSpecRule
impl Sync for FlowSpecRule
impl Unpin for FlowSpecRule
impl UnsafeUnpin for FlowSpecRule
impl UnwindSafe for FlowSpecRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more