pub struct FlagsRestriction {
pub mandatory: Vec<String>,
pub forbidden: Vec<String>,
}Expand description
Restriction for mandatory and forbidden router flags.
This restriction filters routers based on their assigned flags. Routers must have all mandatory flags and none of the forbidden flags.
§Common Flag Combinations
| Use Case | Mandatory | Forbidden |
|---|---|---|
| Vanguard Layer 2 | Fast, Stable, Valid | Authority, BadExit |
| Vanguard Layer 3 | Fast, Stable, Valid | Authority, BadExit |
| Exit Selection | Fast, Stable, Valid, Exit | BadExit |
§Example
use vanguards_rs::node_selection::FlagsRestriction;
// Require Fast, Stable, Valid; forbid Authority
let restriction = FlagsRestriction::new(
vec!["Fast".to_string(), "Stable".to_string(), "Valid".to_string()],
vec!["Authority".to_string()],
);§See Also
NodeRestriction- The trait this implementsNodeRestrictionList- Combine with other restrictions
Fields§
§mandatory: Vec<String>Flags that must be present on the router.
forbidden: Vec<String>Flags that must not be present on the router.
Implementations§
Trait Implementations§
Source§impl Clone for FlagsRestriction
impl Clone for FlagsRestriction
Source§fn clone(&self) -> FlagsRestriction
fn clone(&self) -> FlagsRestriction
Returns a duplicate 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 Debug for FlagsRestriction
impl Debug for FlagsRestriction
Source§impl NodeRestriction for FlagsRestriction
impl NodeRestriction for FlagsRestriction
Auto Trait Implementations§
impl Freeze for FlagsRestriction
impl RefUnwindSafe for FlagsRestriction
impl Send for FlagsRestriction
impl Sync for FlagsRestriction
impl Unpin for FlagsRestriction
impl UnwindSafe for FlagsRestriction
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