pub struct MultiRegionPoolManager { /* private fields */ }Expand description
Multi-region pool manager
Implementations§
Source§impl MultiRegionPoolManager
impl MultiRegionPoolManager
Sourcepub async fn add_regional_pool(&self, config: RegionalPoolConfig) -> Result<()>
pub async fn add_regional_pool(&self, config: RegionalPoolConfig) -> Result<()>
Add a regional pool
Sourcepub fn get_regional_pool(&self, region_code: &str) -> Result<PgPool>
pub fn get_regional_pool(&self, region_code: &str) -> Result<PgPool>
Get pool for a specific region
Sourcepub fn get_closest_pool(
&self,
latitude: f64,
longitude: f64,
) -> Result<(String, PgPool)>
pub fn get_closest_pool( &self, latitude: f64, longitude: f64, ) -> Result<(String, PgPool)>
Get pool for the closest region to a given location
Sourcepub fn get_primary_pool(&self) -> Result<PgPool>
pub fn get_primary_pool(&self) -> Result<PgPool>
Get primary pool
Sourcepub fn get_current_pool(&self) -> Result<PgPool>
pub fn get_current_pool(&self) -> Result<PgPool>
Get pool for the current active region
Sourcepub fn failover_to_region(&self, region_code: &str) -> Result<()>
pub fn failover_to_region(&self, region_code: &str) -> Result<()>
Switch to a different region (failover)
Sourcepub async fn measure_replication_lag(
&self,
source_region: &str,
replica_region: &str,
) -> Result<ReplicationLag>
pub async fn measure_replication_lag( &self, source_region: &str, replica_region: &str, ) -> Result<ReplicationLag>
Measure replication lag for a replica
Sourcepub fn get_replication_lags(&self) -> HashMap<String, ReplicationLag>
pub fn get_replication_lags(&self) -> HashMap<String, ReplicationLag>
Get all replication lags
Sourcepub fn are_all_replicas_healthy(&self) -> bool
pub fn are_all_replicas_healthy(&self) -> bool
Check if all replicas are healthy
Sourcepub fn get_unhealthy_replicas(&self) -> Vec<String>
pub fn get_unhealthy_replicas(&self) -> Vec<String>
Get unhealthy replicas
Sourcepub fn auto_failover(&self) -> Result<String>
pub fn auto_failover(&self) -> Result<String>
Auto-failover to the best available region
Sourcepub fn list_regions(&self) -> Vec<RegionalPoolConfig>
pub fn list_regions(&self) -> Vec<RegionalPoolConfig>
List all regions
Sourcepub fn get_current_region(&self) -> Option<String>
pub fn get_current_region(&self) -> Option<String>
Get current region
Auto Trait Implementations§
impl Freeze for MultiRegionPoolManager
impl !RefUnwindSafe for MultiRegionPoolManager
impl Send for MultiRegionPoolManager
impl Sync for MultiRegionPoolManager
impl Unpin for MultiRegionPoolManager
impl !UnwindSafe for MultiRegionPoolManager
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more