pub struct ContextFormattingStyle {
pub function: FormattingFunction,
}Expand description
Formatting preferences for a context when displayed in a report.
This struct allows a ContextHandler to specify how it prefers to be
formatted when its context is displayed as part of an error report. The
formatting system may or may not respect these preferences depending on the
formatter implementation.
§Fields
§Default
The default is to use FormattingFunction::Display.
§Examples
use rootcause_internals::handlers::{ContextFormattingStyle, FormattingFunction};
// Prefer display formatting (the default)
let style = ContextFormattingStyle::default();
assert_eq!(style.function, FormattingFunction::Display);
// Explicitly request debug formatting
let debug_style = ContextFormattingStyle {
function: FormattingFunction::Debug,
};Fields§
§function: FormattingFunctionThe preferred formatting function to use
Trait Implementations§
Source§impl Clone for ContextFormattingStyle
impl Clone for ContextFormattingStyle
Source§fn clone(&self) -> ContextFormattingStyle
fn clone(&self) -> ContextFormattingStyle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextFormattingStyle
impl Debug for ContextFormattingStyle
Source§impl Default for ContextFormattingStyle
impl Default for ContextFormattingStyle
Source§fn default() -> ContextFormattingStyle
fn default() -> ContextFormattingStyle
Returns the “default value” for a type. Read more
impl Copy for ContextFormattingStyle
Auto Trait Implementations§
impl Freeze for ContextFormattingStyle
impl RefUnwindSafe for ContextFormattingStyle
impl Send for ContextFormattingStyle
impl Sync for ContextFormattingStyle
impl Unpin for ContextFormattingStyle
impl UnwindSafe for ContextFormattingStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more