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§
Sourcefn migrate(
&self,
from: SchemaVersion,
payload: &[u8],
) -> Result<Vec<u8>, ExecutionError>
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".