pub struct ConnectionMigrationManager { /* private fields */ }Expand description
Manages QUIC connection migration
Implementations§
Source§impl ConnectionMigrationManager
impl ConnectionMigrationManager
Sourcepub fn new(config: MigrationConfig) -> Self
pub fn new(config: MigrationConfig) -> Self
Create a new connection migration manager
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Create with conservative configuration
Sourcepub fn initiate_migration(
&self,
peer_id: PeerId,
old_address: Multiaddr,
new_address: Multiaddr,
) -> Result<(), MigrationError>
pub fn initiate_migration( &self, peer_id: PeerId, old_address: Multiaddr, new_address: Multiaddr, ) -> Result<(), MigrationError>
Sourcepub fn update_migration_state(
&self,
peer_id: &PeerId,
new_state: MigrationState,
) -> Result<(), MigrationError>
pub fn update_migration_state( &self, peer_id: &PeerId, new_state: MigrationState, ) -> Result<(), MigrationError>
Update the state of an ongoing migration
Sourcepub fn complete_migration(&self, peer_id: &PeerId) -> Result<(), MigrationError>
pub fn complete_migration(&self, peer_id: &PeerId) -> Result<(), MigrationError>
Mark a migration as completed successfully
Sourcepub fn fail_migration(
&self,
peer_id: &PeerId,
error: String,
) -> Result<(), MigrationError>
pub fn fail_migration( &self, peer_id: &PeerId, error: String, ) -> Result<(), MigrationError>
Mark a migration as failed
Sourcepub fn retry_migration(&self, peer_id: &PeerId) -> Result<(), MigrationError>
pub fn retry_migration(&self, peer_id: &PeerId) -> Result<(), MigrationError>
Retry a failed migration
Sourcepub fn is_migrating(&self, peer_id: &PeerId) -> bool
pub fn is_migrating(&self, peer_id: &PeerId) -> bool
Check if a migration is in progress for a peer
Sourcepub fn get_migration_state(&self, peer_id: &PeerId) -> Option<MigrationState>
pub fn get_migration_state(&self, peer_id: &PeerId) -> Option<MigrationState>
Get the current migration state for a peer
Sourcepub fn get_active_migrations(&self) -> Vec<MigrationAttempt>
pub fn get_active_migrations(&self) -> Vec<MigrationAttempt>
Get all active migration attempts
Sourcepub fn stats(&self) -> MigrationStats
pub fn stats(&self) -> MigrationStats
Get migration statistics
Sourcepub fn can_migrate(&self, peer_id: &PeerId) -> bool
pub fn can_migrate(&self, peer_id: &PeerId) -> bool
Check if a peer can be migrated (respects cooldown)
Sourcepub fn config(&self) -> &MigrationConfig
pub fn config(&self) -> &MigrationConfig
Get the configuration
Sourcepub fn cleanup_timeouts(&self)
pub fn cleanup_timeouts(&self)
Clean up timed-out migrations
Auto Trait Implementations§
impl Freeze for ConnectionMigrationManager
impl !RefUnwindSafe for ConnectionMigrationManager
impl Send for ConnectionMigrationManager
impl Sync for ConnectionMigrationManager
impl Unpin for ConnectionMigrationManager
impl !UnwindSafe for ConnectionMigrationManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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