Struct netstack3_core::filter::Rule
pub struct Rule<I, DeviceClass, RuleInfo>where
I: IpExt,{
pub matcher: PacketMatcher<I, DeviceClass>,
pub action: Action<I, DeviceClass, RuleInfo>,
pub validation_info: RuleInfo,
}
Expand description
A set of criteria (matchers) and a resultant action to take if a given packet matches.
Fields§
§matcher: PacketMatcher<I, DeviceClass>
The criteria that a packet must match for the action to be executed.
action: Action<I, DeviceClass, RuleInfo>
The action to take on a matching packet.
validation_info: RuleInfo
Opaque information about this rule for use when validating and converting state provided by Bindings into Core filtering state. This is only used when installing filtering state, and allows Core to report to Bindings which rule caused a particular error. It is zero-sized for validated state.
Trait Implementations§
§impl<I, DeviceClass, RuleInfo, IpType> GenericOverIp<IpType> for Rule<I, DeviceClass, RuleInfo>
impl<I, DeviceClass, RuleInfo, IpType> GenericOverIp<IpType> for Rule<I, DeviceClass, RuleInfo>
§impl<I, DeviceClass> Inspectable for Rule<I, DeviceClass, ()>
impl<I, DeviceClass> Inspectable for Rule<I, DeviceClass, ()>
§fn record<Inspector>(&self, inspector: &mut Inspector)where
Inspector: Inspector,
fn record<Inspector>(&self, inspector: &mut Inspector)where
Inspector: Inspector,
Records this value into
inspector
.Auto Trait Implementations§
impl<I, DeviceClass, RuleInfo> Freeze for Rule<I, DeviceClass, RuleInfo>
impl<I, DeviceClass, RuleInfo> RefUnwindSafe for Rule<I, DeviceClass, RuleInfo>where
RuleInfo: RefUnwindSafe,
<I as Ip>::Addr: RefUnwindSafe,
DeviceClass: RefUnwindSafe,
<I as IpProtoExt>::Proto: RefUnwindSafe,
impl<I, DeviceClass, RuleInfo> Send for Rule<I, DeviceClass, RuleInfo>
impl<I, DeviceClass, RuleInfo> Sync for Rule<I, DeviceClass, RuleInfo>
impl<I, DeviceClass, RuleInfo> Unpin for Rule<I, DeviceClass, RuleInfo>
impl<I, DeviceClass, RuleInfo> UnwindSafe for Rule<I, DeviceClass, RuleInfo>where
RuleInfo: UnwindSafe + RefUnwindSafe,
<I as Ip>::Addr: UnwindSafe + RefUnwindSafe,
DeviceClass: UnwindSafe + RefUnwindSafe,
<I as IpProtoExt>::Proto: UnwindSafe + RefUnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more
source§impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
§type Data = <L as UnlockedAccessMarkerFor<T>>::Data
type Data = <L as UnlockedAccessMarkerFor<T>>::Data
The type of state being accessed.
§type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data
where
T: 'l
type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data where T: 'l
A guard providing read access to the data.
source§fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
How to access the state.