Skip to main content

ChainLoggable

Trait ChainLoggable 

Source
pub trait ChainLoggable {
    // Required methods
    fn chain_event_source(&self) -> &str;
    fn chain_event_kind(&self) -> &str;
    fn chain_event_payload(&self) -> Value;
}
Expand description

Trait for types that can be logged to the ExoChain audit trail.

Implementors define how they map to a chain event kind string and a JSON payload. The ChainManager::append_loggable convenience method uses these to append an event without the caller needing to hand-craft the source/kind/payload triple.

Required Methods§

Source

fn chain_event_source(&self) -> &str

The source subsystem (e.g. “supervisor”, “governance”, “ipc”).

Source

fn chain_event_kind(&self) -> &str

The event kind string (e.g. “agent.restart”, “governance.deny”).

Source

fn chain_event_payload(&self) -> Value

Build the JSON payload for the chain event.

Implementors§