pub struct RuleMatcher<I: Ip> {
pub from: Option<Subnet<I::Addr>>,
pub locally_generated: Option<bool>,
pub bound_device: Option<InterfaceMatcher>,
pub mark_1: Option<MarkMatcher>,
pub mark_2: Option<MarkMatcher>,
}
Expand description
The matcher part of the rule that is used to match packets.
The default matcher is the one that matches every packets, i.e., all the fields are none.
Fields§
§from: Option<Subnet<I::Addr>>
Matches whether the source address of the packet is from the subnet.
locally_generated: Option<bool>
Matches the packet iff the packet was locally generated.
bound_device: Option<InterfaceMatcher>
Matches the packet iff the socket that was bound to the device using
SO_BINDTODEVICE
.
mark_1: Option<MarkMatcher>
The matcher for the MARK_1 domain.
mark_2: Option<MarkMatcher>
The matcher for the MARK_2 domain.
Trait Implementations§
Source§impl<I: Clone + Ip> Clone for RuleMatcher<I>
impl<I: Clone + Ip> Clone for RuleMatcher<I>
Source§fn clone(&self) -> RuleMatcher<I>
fn clone(&self) -> RuleMatcher<I>
Returns a copy 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<I: Default + Ip> Default for RuleMatcher<I>
impl<I: Default + Ip> Default for RuleMatcher<I>
Source§fn default() -> RuleMatcher<I>
fn default() -> RuleMatcher<I>
Returns the “default value” for a type. Read more
Source§impl From<RuleMatcher<Ipv4>> for RuleMatcherV4
impl From<RuleMatcher<Ipv4>> for RuleMatcherV4
Source§fn from(_: RuleMatcher<Ipv4>) -> Self
fn from(_: RuleMatcher<Ipv4>) -> Self
Converts to this type from the input type.
Source§impl From<RuleMatcher<Ipv6>> for RuleMatcherV6
impl From<RuleMatcher<Ipv6>> for RuleMatcherV6
Source§fn from(_: RuleMatcher<Ipv6>) -> Self
fn from(_: RuleMatcher<Ipv6>) -> Self
Converts to this type from the input type.
Source§impl TryFrom<RuleMatcherV4> for RuleMatcher<Ipv4>
impl TryFrom<RuleMatcherV4> for RuleMatcher<Ipv4>
Source§type Error = RuleFidlConversionError
type Error = RuleFidlConversionError
The type returned in the event of a conversion error.
Source§impl TryFrom<RuleMatcherV6> for RuleMatcher<Ipv6>
impl TryFrom<RuleMatcherV6> for RuleMatcher<Ipv6>
Source§type Error = RuleFidlConversionError
type Error = RuleFidlConversionError
The type returned in the event of a conversion error.
impl<I: Eq + Ip> Eq for RuleMatcher<I>
impl<I: Ip> StructuralPartialEq for RuleMatcher<I>
Auto Trait Implementations§
impl<I> Freeze for RuleMatcher<I>
impl<I> RefUnwindSafe for RuleMatcher<I>
impl<I> Send for RuleMatcher<I>
impl<I> Sync for RuleMatcher<I>
impl<I> Unpin for RuleMatcher<I>
impl<I> UnwindSafe for RuleMatcher<I>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.