store_api::manifest

Trait MetaAction

source
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§

source

type Error: ErrorExt + Send + Sync

Required Methods§

source

fn set_protocol(&mut self, action: ProtocolAction)

Set a protocol action into meta action

source

fn set_prev_version(&mut self, version: ManifestVersion)

Set previous valid manifest version.

source

fn encode(&self) -> Result<Vec<u8>, Self::Error>

Encode this action into a byte vector

source

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.

Implementors§