pub struct ProtocolMigrator { /* private fields */ }Expand description
Protocol migrator for version transitions
Implementations§
Source§impl ProtocolMigrator
impl ProtocolMigrator
Sourcepub fn new(strategy: MigrationStrategy) -> Self
pub fn new(strategy: MigrationStrategy) -> Self
Create a new protocol migrator with the given strategy
Sourcepub fn check_compatibility(
&self,
message: &Message,
target_version: ProtocolVersion,
) -> CompatibilityInfo
pub fn check_compatibility( &self, message: &Message, target_version: ProtocolVersion, ) -> CompatibilityInfo
Check if a message is compatible with a target protocol version
Sourcepub fn migrate(
&self,
message: Message,
target_version: ProtocolVersion,
) -> Result<Message, MigrationError>
pub fn migrate( &self, message: Message, target_version: ProtocolVersion, ) -> Result<Message, MigrationError>
Migrate a message to a different protocol version
Sourcepub fn strategy(&self) -> MigrationStrategy
pub fn strategy(&self) -> MigrationStrategy
Get the current strategy
Sourcepub fn set_strategy(&mut self, strategy: MigrationStrategy)
pub fn set_strategy(&mut self, strategy: MigrationStrategy)
Set a new strategy
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtocolMigrator
impl RefUnwindSafe for ProtocolMigrator
impl Send for ProtocolMigrator
impl Sync for ProtocolMigrator
impl Unpin for ProtocolMigrator
impl UnwindSafe for ProtocolMigrator
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