Skip to main content

PayloadMigrator

Trait PayloadMigrator 

Source
pub trait PayloadMigrator: Send + Sync {
    // Required method
    fn migrate(
        &self,
        from: SchemaVersion,
        payload: &[u8],
    ) -> Result<Vec<u8>, ExecutionError>;
}
Expand description

Pure adapter that upgrades one supported historical payload directly to the handler’s current schema. Database migrations remain separate.

Required Methods§

Source

fn migrate( &self, from: SchemaVersion, payload: &[u8], ) -> Result<Vec<u8>, ExecutionError>

Returns current-schema Postcard bytes for a historical payload.

§Errors

Returns ExecutionError when the historical payload is malformed or cannot be upgraded.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§