Skip to main content

HostLogSink

Trait HostLogSink 

Source
pub trait HostLogSink:
    Send
    + Sync
    + Debug {
    // Required method
    fn emit(&self, message: &str);
}
Expand description

Minimal host-side log sink for invoke diagnostics.

Production code uses StderrLogSink; tests inject CapturingLogSink to verify log content and bounds without capturing stderr. Keeping this trait tiny avoids pulling in a full logging framework while still making the runtime’s only log call testable.

The sink receives a single pre-formatted message per invoke error. The message is constructed from the already-truncated InvokeError::detail, so a malicious 16 KiB guest error payload can never produce a 16 KiB log line.

Required Methods§

Source

fn emit(&self, message: &str)

Emit a single log line. The implementation decides where it goes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§