Trait JournalEncoding
pub trait JournalEncoding: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn encode(&self, event: &EngineEvent) -> Result<Vec<u8>, JournalError>;
fn decode(&self, bytes: &[u8]) -> Result<EngineEvent, JournalError>;
}Expand description
Encode / decode an EngineEvent to / from bytes.
Required Methods§
fn encode(&self, event: &EngineEvent) -> Result<Vec<u8>, JournalError>
fn encode(&self, event: &EngineEvent) -> Result<Vec<u8>, JournalError>
Serialize an event to bytes.
fn decode(&self, bytes: &[u8]) -> Result<EngineEvent, JournalError>
fn decode(&self, bytes: &[u8]) -> Result<EngineEvent, JournalError>
Deserialize an event from bytes.