Skip to main content

CanonicalLog

Trait CanonicalLog 

Source
pub trait CanonicalLog: Send + Sync {
    // Required methods
    fn service_name(&self) -> &ServiceName;
    fn emit(&self, event: LogEvent) -> Result<(), EventError>;
}
Expand description

A trusted synchronous canonical event receiver.

Implementations must return promptly, perform no sink I/O or capacity wait, and never panic. Libraries treat rejection as best effort.

Required Methods§

Source

fn service_name(&self) -> &ServiceName

Returns the receiver’s service identity.

Source

fn emit(&self, event: LogEvent) -> Result<(), EventError>

Attempts immediate event admission.

§Errors

Returns an event error when the receiver rejects the event.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§