pub struct ReplicationController { /* private fields */ }Expand description
Replication controller for managing cross-region replication
Implementations§
Source§impl ReplicationController
impl ReplicationController
Sourcepub fn set_default_policy(&self, policy: ReplicationPolicy)
pub fn set_default_policy(&self, policy: ReplicationPolicy)
Set default replication policy
Sourcepub fn register_region(&self, region: impl Into<String>)
pub fn register_region(&self, region: impl Into<String>)
Register available region
Sourcepub fn unregister_region(&self, region: &str)
pub fn unregister_region(&self, region: &str)
Unregister region
Sourcepub fn add_callback<C: ReplicationCallback + 'static>(&self, callback: C)
pub fn add_callback<C: ReplicationCallback + 'static>(&self, callback: C)
Add replication callback
Sourcepub fn replicate(
&self,
resource_id: impl Into<String>,
primary_region: impl Into<String>,
policy: Option<ReplicationPolicy>,
)
pub fn replicate( &self, resource_id: impl Into<String>, primary_region: impl Into<String>, policy: Option<ReplicationPolicy>, )
Start replication for a resource
Sourcepub fn update_state(&self, resource_id: &str, region: &str, state: ReplicaState)
pub fn update_state(&self, resource_id: &str, region: &str, state: ReplicaState)
Update replica state
Sourcepub fn update_lag(&self, resource_id: &str, region: &str, lag_ms: u64)
pub fn update_lag(&self, resource_id: &str, region: &str, lag_ms: u64)
Update replication lag
Sourcepub fn get_status(&self, resource_id: &str) -> Option<ReplicationStatus>
pub fn get_status(&self, resource_id: &str) -> Option<ReplicationStatus>
Get replication status
Sourcepub fn list_replicated(&self) -> Vec<ReplicationStatus>
pub fn list_replicated(&self) -> Vec<ReplicationStatus>
Get all replicated resources
Sourcepub fn stop_replication(&self, resource_id: &str)
pub fn stop_replication(&self, resource_id: &str)
Stop replication for a resource
Sourcepub fn promote(&self, resource_id: &str, new_primary: &str) -> bool
pub fn promote(&self, resource_id: &str, new_primary: &str) -> bool
Promote a replica to primary
Sourcepub fn is_replicated_to(&self, resource_id: &str, region: &str) -> bool
pub fn is_replicated_to(&self, resource_id: &str, region: &str) -> bool
Check if resource is replicated to a region
Sourcepub fn healthy_replicas(&self, resource_id: &str) -> Vec<String>
pub fn healthy_replicas(&self, resource_id: &str) -> Vec<String>
Get healthy replicas for a resource
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ReplicationController
impl !RefUnwindSafe for ReplicationController
impl Send for ReplicationController
impl Sync for ReplicationController
impl Unpin for ReplicationController
impl !UnwindSafe for ReplicationController
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