Skip to main content

LogSink

Trait LogSink 

Source
pub trait LogSink {
    // Required method
    fn write_str(&mut self, s: &str);

    // Provided method
    fn flush(&mut self) { ... }
}
Expand description

A minimal sink for kernel/OS logging.

The sink decides where bytes go (serial, VGA, hypervisor console, ring buffer, etc.).

§Contract

  • write_str is expected to be best-effort and should not panic.
  • Implementations should handle being called many times with small fragments.
  • The default LogSink::flush is a no-op; override it if your device benefits from it.

Required Methods§

Source

fn write_str(&mut self, s: &str)

Writes a string fragment to the output device.

Provided Methods§

Source

fn flush(&mut self)

Flushes buffered output if applicable.

Implementors§

Source§

impl<const N: usize> LogSink for RingLog<N>