pub trait MetaAction:
Serialize
+ DeserializeOwned
+ Send
+ Sync
+ Clone
+ Debug {
type Error: ErrorExt + Send + Sync;
// Required methods
fn set_protocol(&mut self, action: ProtocolAction);
fn set_prev_version(&mut self, version: ManifestVersion);
fn encode(&self) -> Result<Vec<u8>, Self::Error>;
fn decode(
bs: &[u8],
reader_version: ProtocolVersion,
) -> Result<(Self, Option<ProtocolAction>), Self::Error>;
}
Expand description
The action to alter metadata
Required Associated Types§
Required Methods§
sourcefn set_protocol(&mut self, action: ProtocolAction)
fn set_protocol(&mut self, action: ProtocolAction)
Set a protocol action into meta action
sourcefn set_prev_version(&mut self, version: ManifestVersion)
fn set_prev_version(&mut self, version: ManifestVersion)
Set previous valid manifest version.
sourcefn decode(
bs: &[u8],
reader_version: ProtocolVersion,
) -> Result<(Self, Option<ProtocolAction>), Self::Error>
fn decode( bs: &[u8], reader_version: ProtocolVersion, ) -> Result<(Self, Option<ProtocolAction>), Self::Error>
Decode self from byte slice with reader protocol version, return error when reader version is not supported.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.