pub enum Filter {
Show 25 variants
OriginAsn(u32),
OriginAsns(Vec<u32>),
Prefix(IpNet, PrefixMatchType),
Prefixes(Vec<IpNet>, PrefixMatchType),
PeerIp(IpAddr),
PeerIps(Vec<IpAddr>),
PeerAsn(u32),
PeerAsns(Vec<u32>),
Type(ElemType),
IpVersion(IpVersion),
TsStart(f64),
TsEnd(f64),
AsPath(ComparableRegex),
Community(ComparableRegex),
OnlyToCustomer(Asn),
NextHop(IpAddr),
Origin(Origin),
LocalPref(u32),
Med(u32),
Atomic(bool),
AggrAsn(Asn),
AggrIp(Ipv4Addr),
PeerBgpId(Ipv4Addr),
FieldPresent(PresentField),
Negated(Box<Filter>),
}Expand description
Filter enum: definition of types of filters
The available filters are (filter_type (FilterType) – definition):
origin_asn(OriginAsn(u32)) – origin AS numberorigin_asns(OriginAsns(Vec<u32>)) – multiple origin AS numbers (OR logic)prefix(_super, _sub, _super_sub)(Prefix(IpNet, PrefixMatchType)) – network prefix and match typeprefixes(_super, _sub, _super_sub)(Prefixes(Vec<IpNet>, PrefixMatchType)) – multiple network prefixes (OR logic)peer_ip(PeerIp(IpAddr)) – peer’s IP addresspeer_ips(PeerIps(Vec<IpAddr>)) – peers’ IP addresses (OR logic)peer_asn(PeerAsn(u32)) – peer’s AS numberpeer_asns(PeerAsns(Vec<u32>)) – multiple peer AS numbers (OR logic)type(Type(ElemType)) – message type (withdraworannounce)ts_start(TsStart(f64)) andts_end(TsEnd(f64)) – start and end unix timestampas_path(ComparableRegex) – regular expression for AS path stringcommunity(ComparableRegex) – regular expression for community stringip_version(IpVersion) – IP version (ipv4oripv6)otc(OnlyToCustomer(Asn)) – only-to-customer (RFC 9234) ASN;*for “present”,!*for “absent”next_hop(NextHop(IpAddr)) – next hop IP address;*for “present”,!*for “absent”origin(Origin(Origin)) – origin attribute (igp,egp,incomplete);*for “present”,!*for “absent”local_pref(LocalPref(u32)) – local preference value;*for “present”,!*for “absent”med(Med(u32)) – multi-exit discriminator value;*for “present”,!*for “absent”atomic(Atomic(bool)) – atomic aggregate flagaggr_asn(AggrAsn(Asn)) – aggregator ASN;*for “present”,!*for “absent”aggr_ip(AggrIp(Ipv4Addr)) – aggregator IP address;*for “present”,!*for “absent”peer_bgp_id(PeerBgpId(Ipv4Addr)) – peer BGP identifier (router ID);*for “present”,!*for “absent”present(FieldPresent(PresentField)) – presence check for optional fields; use*as value
Negative filters: Most filters support negation by prefixing the filter value with !.
For example, origin_asn=!13335 matches elements where origin AS is NOT 13335.
This creates a Negated(Box<Filter>) variant that inverts the match result.
Presence filters: Fields that are Option<T> support * as a wildcard value to check
whether the field is present (Some) or absent (None). For example, otc=* matches
elements that carry an OTC value, while otc=!* matches elements without one.
Variants§
OriginAsn(u32)
OriginAsns(Vec<u32>)
Prefix(IpNet, PrefixMatchType)
Prefixes(Vec<IpNet>, PrefixMatchType)
PeerIp(IpAddr)
PeerIps(Vec<IpAddr>)
PeerAsn(u32)
PeerAsns(Vec<u32>)
Type(ElemType)
IpVersion(IpVersion)
TsStart(f64)
TsEnd(f64)
AsPath(ComparableRegex)
Community(ComparableRegex)
OnlyToCustomer(Asn)
NextHop(IpAddr)
Origin(Origin)
LocalPref(u32)
Med(u32)
Atomic(bool)
AggrAsn(Asn)
AggrIp(Ipv4Addr)
PeerBgpId(Ipv4Addr)
FieldPresent(PresentField)
Matches when the specified optional field is present (Some). Use * as the
filter value to construct this, or !* to negate (absent).
Negated(Box<Filter>)
Negated filter - matches when the inner filter does NOT match
Implementations§
Trait Implementations§
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Forget for Filter
impl Freeze for Filterwhere
*const u8 is !null: Freeze,
PhantomData<u32>: Freeze,
PhantomData<IpNet>: Freeze,
PhantomData<IpAddr>: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<RegexI> is !null: Freeze,
PhantomData<ArcInner<RegexI>>: Freeze,
*const Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>> is !null: Freeze,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>>>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const Filter is !null: Freeze,
PhantomData<Filter>: Freeze,
impl Move for Filter
impl RefUnwindSafe for Filterwhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>>: RefUnwindSafe,
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnsafeUnpin for Filterwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
PhantomData<IpNet>: UnsafeUnpin,
PhantomData<IpAddr>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<RegexI> is !null: UnsafeUnpin,
PhantomData<ArcInner<RegexI>>: UnsafeUnpin,
*const Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>> is !null: UnsafeUnpin,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>>>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const Filter is !null: UnsafeUnpin,
PhantomData<Filter>: UnsafeUnpin,
impl UnwindSafe for Filterwhere
RawVecInner: UnwindSafe,
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>>>: UnwindSafe,
Arc<str>: UnwindSafe,
BoxRaw<Filter>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more