Struct std::panicking::internal::PanicFormatter
Small formatter with as few dependencies as possible.
PanicFormatter has no buffering, no checking for unwritten bytes. It just writes directly to fd 2. This is both for reliability, to allow higher-level IO code to panic safely but also to break potential circular dependencies in static initialization.
If the buffer is provided, it will write the message there instead. This is used to capture the panics when using managed threads and during constant evaluation. Unlike SliceFormatter, this will try to write as much as possible to the buffer, even if it is not large enough to hold the entire message.
Fields
-
-
written: usize
Methods
impl PanicFormatter { ... }
-
fn new() -> PanicFormatter
Create a new formatter that writes to fd 2.
-
fn with_buffer(buf: &mut [u8]) -> PanicFormatter
Create a new formatter that writes to the provided buffer.
-
fn write_str(self: &mut PanicFormatter, buf: &[u8]) -> Result<(), Error>
Mixins
impl PanicFormatter { ... }
-
mixin Formatter<PanicFormatter>
-
Write a single character