pub struct MigrationCoordinator { /* private fields */ }Expand description
Coordinates connection migration from relay to direct path
Implementations§
Source§impl MigrationCoordinator
impl MigrationCoordinator
Sourcepub fn new(config: MigrationConfig) -> Self
pub fn new(config: MigrationConfig) -> Self
Create a new migration coordinator
Sourcepub fn stats(&self) -> Arc<MigrationStats>
pub fn stats(&self) -> Arc<MigrationStats>
Get statistics
Sourcepub async fn set_relay(&self, relay: SocketAddr)
pub async fn set_relay(&self, relay: SocketAddr)
Set the relay address for this coordinator
Sourcepub async fn state(&self, peer: SocketAddr) -> MigrationState
pub async fn state(&self, peer: SocketAddr) -> MigrationState
Get current migration state for a peer
Sourcepub async fn add_candidates(&self, peer: SocketAddr, addrs: Vec<SocketAddr>)
pub async fn add_candidates(&self, peer: SocketAddr, addrs: Vec<SocketAddr>)
Register candidate addresses for a peer
Sourcepub async fn start_migration(&self, peer: SocketAddr)
pub async fn start_migration(&self, peer: SocketAddr)
Start migration attempt for a peer
Sourcepub async fn poll(&self, peer: SocketAddr) -> MigrationState
pub async fn poll(&self, peer: SocketAddr) -> MigrationState
Poll migration progress - should be called periodically
Sourcepub async fn report_validated_path(
&self,
peer: SocketAddr,
path: SocketAddr,
rtt: Duration,
)
pub async fn report_validated_path( &self, peer: SocketAddr, path: SocketAddr, rtt: Duration, )
Report a validated path (called when PATH_RESPONSE received)
Sourcepub async fn complete_migration(&self, peer: SocketAddr)
pub async fn complete_migration(&self, peer: SocketAddr)
Complete migration to direct path
Sourcepub async fn fallback_to_relay(&self, peer: SocketAddr, reason: &str)
pub async fn fallback_to_relay(&self, peer: SocketAddr, reason: &str)
Force fallback to relay
Sourcepub async fn reset(&self, peer: SocketAddr)
pub async fn reset(&self, peer: SocketAddr)
Reset migration state for a peer
Sourcepub async fn migrating_peers(&self) -> Vec<SocketAddr>
pub async fn migrating_peers(&self) -> Vec<SocketAddr>
Get all peers currently migrating
Sourcepub async fn direct_peers(&self) -> Vec<SocketAddr>
pub async fn direct_peers(&self) -> Vec<SocketAddr>
Get all peers with direct paths
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MigrationCoordinator
impl !RefUnwindSafe for MigrationCoordinator
impl Send for MigrationCoordinator
impl Sync for MigrationCoordinator
impl Unpin for MigrationCoordinator
impl !UnwindSafe for MigrationCoordinator
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