pub struct GeographicConfig {
pub min_regions: usize,
pub max_single_region_ratio: f64,
pub blocked_regions: Vec<String>,
pub enforcement_mode: GeoEnforcementMode,
}Expand description
Configuration for geographic diversity enforcement
Fields§
§min_regions: usizeMinimum number of regions required (default: 3)
max_single_region_ratio: f64Maximum ratio of peers from a single region (default: 0.4 = 40%)
blocked_regions: Vec<String>Regions to outright block
enforcement_mode: GeoEnforcementModeEnforcement mode (LogOnly or Strict)
Implementations§
Source§impl GeographicConfig
impl GeographicConfig
Sourcepub fn with_blocked_region(self, region: impl Into<String>) -> Self
pub fn with_blocked_region(self, region: impl Into<String>) -> Self
Add a blocked region
Sourcepub fn with_max_ratio(self, ratio: f64) -> Self
pub fn with_max_ratio(self, ratio: f64) -> Self
Set maximum single region ratio
Trait Implementations§
Source§impl Clone for GeographicConfig
impl Clone for GeographicConfig
Source§fn clone(&self) -> GeographicConfig
fn clone(&self) -> GeographicConfig
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 GeographicConfig
impl Debug for GeographicConfig
Auto Trait Implementations§
impl Freeze for GeographicConfig
impl RefUnwindSafe for GeographicConfig
impl Send for GeographicConfig
impl Sync for GeographicConfig
impl Unpin for GeographicConfig
impl UnwindSafe for GeographicConfig
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