pub struct RegionConfig {
pub primary_region: Region,
pub fallback_regions: Vec<Region>,
pub latency_preferences: LatencyPreferences,
pub compliance_requirements: ComplianceRequirements,
pub enable_automatic_failover: bool,
pub health_check_config: HealthCheckConfig,
}Expand description
Regional configuration and preferences
Fields§
§primary_region: RegionPrimary region for requests
fallback_regions: Vec<Region>Fallback regions in order of preference
latency_preferences: LatencyPreferencesLatency preferences
compliance_requirements: ComplianceRequirementsCompliance requirements
enable_automatic_failover: boolEnable automatic failover
health_check_config: HealthCheckConfigHealth check configuration
Implementations§
Source§impl RegionConfig
impl RegionConfig
Sourcepub fn with_primary_region(primary_region: Region) -> Self
pub fn with_primary_region(primary_region: Region) -> Self
Create new region config with primary region
Sourcepub fn add_fallback_region(self, region: Region) -> Self
pub fn add_fallback_region(self, region: Region) -> Self
Add fallback region
Sourcepub fn with_max_latency(self, max_latency_ms: u32) -> Self
pub fn with_max_latency(self, max_latency_ms: u32) -> Self
Set maximum acceptable latency
Sourcepub fn with_gdpr_compliance(self) -> Self
pub fn with_gdpr_compliance(self) -> Self
Enable GDPR compliance
Sourcepub fn with_data_residency(self, regions: Vec<Region>) -> Self
pub fn with_data_residency(self, regions: Vec<Region>) -> Self
Add data residency requirement
Sourcepub fn get_compliant_regions(&self) -> Vec<Region>
pub fn get_compliant_regions(&self) -> Vec<Region>
Get all usable regions based on compliance requirements
Sourcepub fn select_optimal_region(
&self,
region_statuses: &[RegionStatus],
) -> Option<Region>
pub fn select_optimal_region( &self, region_statuses: &[RegionStatus], ) -> Option<Region>
Select best region based on current metrics
Trait Implementations§
Source§impl Clone for RegionConfig
impl Clone for RegionConfig
Source§fn clone(&self) -> RegionConfig
fn clone(&self) -> RegionConfig
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 RegionConfig
impl Debug for RegionConfig
Source§impl Default for RegionConfig
impl Default for RegionConfig
Source§impl<'de> Deserialize<'de> for RegionConfig
impl<'de> Deserialize<'de> for RegionConfig
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
Source§impl PartialEq for RegionConfig
impl PartialEq for RegionConfig
Source§impl Serialize for RegionConfig
impl Serialize for RegionConfig
impl StructuralPartialEq for RegionConfig
Auto Trait Implementations§
impl Freeze for RegionConfig
impl RefUnwindSafe for RegionConfig
impl Send for RegionConfig
impl Sync for RegionConfig
impl Unpin for RegionConfig
impl UnwindSafe for RegionConfig
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§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
The type of values stored in the collection. This might be distinct from
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
Converts an entry into a value representation specific to the type of collection. This conversion is crucial
for handling operations on entries, especially when they need to be treated or accessed as individual values,
such as retrieving the value part from a key-value pair in a hash map.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Represents the type of entry that corresponds to the value within the collection.
Type
Entry is defined by the Collection trait.