Files
khadhroony-bot3/kb-lib/src/materializer/api/materializer.rs
2026-07-24 14:23:58 +02:00

23 lines
797 B
Rust

// file: kb-lib/src/materializer/api/materializer.rs
// version: 2
//! Materializer API contract used by business materializer crates.
/// Common contract implemented by all business materializer crates.
pub trait MtMaterializer {
/// Returns the stable materializer name.
fn materializer_name(&self) -> &'static str;
/// Returns the materializer version.
fn materializer_version(&self) -> &'static str;
/// Tests whether this materializer accepts a decoded event.
fn accepts_event(&self, event: &crate::MdDecodedProtocolEvent) -> bool;
/// Materializes a decoded event into zero or more business events.
fn materialize_event(
&self,
event: &crate::MdDecodedProtocolEvent,
) -> kb_core::Result<std::vec::Vec<crate::MdMaterializedEvent>>;
}