PanicWriter

Trait PanicWriter 

Source
pub trait PanicWriter {
    type Config;

    // Required method
    unsafe fn create_panic_writer(config: Self::Config) -> impl IoWrite + Write;
}
Expand description

Interface for chips to create a synchronous writer for panics.

Any mechanism that can output a panic message during a panic must implement PanicWriter to enable the panic() functions to write the output. This requires the mechanism to provide a new constructor for the writer that creates a synchronous writer that implements IoWrite.

This is a dedicated trait because synchronous I/O is only used for panic handling. This allows chips to clearly separate synchronous implementations that are a special case only for panics.

Required Associated Types§

Source

type Config

The configuration data the mechanism needs to configure the writer for panic output.

Required Methods§

Source

unsafe fn create_panic_writer(config: Self::Config) -> impl IoWrite + Write

Create a new synchronous writer capable of sending panic messages.

The writer must implement IoWrite (which is just std:io::Write implemented for no_std).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§