#[non_exhaustive]pub struct Rule {
pub sources: Vec<Source>,
pub destinations: Vec<Destination>,
/* private fields */
}Expand description
Specification of rules.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sources: Vec<Source>Optional. List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ip_blocks match. If not set, the action specified in the ‘action’ field will be applied without any rule checks for the source.
destinations: Vec<Destination>Optional. List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the ‘action’ field will be applied without any rule checks for the destination.
Implementations§
Source§impl Rule
impl Rule
pub fn new() -> Self
Sourcepub fn set_sources<T, V>(self, v: T) -> Self
pub fn set_sources<T, V>(self, v: T) -> Self
Sets the value of sources.
Sourcepub fn set_destinations<T, V>(self, v: T) -> Self
pub fn set_destinations<T, V>(self, v: T) -> Self
Sets the value of destinations.
Trait Implementations§
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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