pub struct Rule {
pub direction: Direction,
pub destination: Destination,
pub protocol: Option<Protocol>,
pub ports: Option<PortRange>,
pub action: Action,
}Expand description
A single network rule.
Fields§
§direction: DirectionTraffic direction.
destination: DestinationDestination filter.
protocol: Option<Protocol>Protocol filter (None = any protocol).
ports: Option<PortRange>Port filter (None = any port).
action: ActionAction to take.
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn allow_outbound(destination: Destination) -> Self
pub fn allow_outbound(destination: Destination) -> Self
Convenience: allow outbound to a destination.
Sourcepub fn deny_outbound(destination: Destination) -> Self
pub fn deny_outbound(destination: Destination) -> Self
Convenience: deny outbound to a destination.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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