pub struct AttachmentFormattingStyle {
pub placement: AttachmentFormattingPlacement,
pub function: FormattingFunction,
pub priority: i32,
}Expand description
Formatting preferences for an attachment when displayed in a report.
This struct allows an AttachmentHandler to specify how and where it
prefers to be displayed when included in an error report. The formatting
system may or may not respect these preferences depending on the formatter
implementation.
§Fields
placement: Where the attachment should appear (inline, appendix, hidden, etc.)function: Whether to useDisplayorDebugformattingpriority: Display order preference (higher values appear earlier)
§Default
The default is inline display formatting with priority 0.
§Examples
use rootcause_internals::handlers::{
AttachmentFormattingPlacement, AttachmentFormattingStyle, FormattingFunction,
};
// Default: inline display formatting
let style = AttachmentFormattingStyle::default();
assert_eq!(style.placement, AttachmentFormattingPlacement::Inline);
assert_eq!(style.function, FormattingFunction::Display);
assert_eq!(style.priority, 0);
// High-priority attachment in appendix
let appendix_style = AttachmentFormattingStyle {
placement: AttachmentFormattingPlacement::Appendix {
appendix_name: "Stack Trace",
},
function: FormattingFunction::Debug,
priority: 10,
};Fields§
§placement: AttachmentFormattingPlacementThe preferred attachment placement
function: FormattingFunctionThe preferred formatting function to use
priority: i32The preferred formatting priority. Higher priority means a preference for being printed earlier in the report
Trait Implementations§
Source§impl Clone for AttachmentFormattingStyle
impl Clone for AttachmentFormattingStyle
Source§fn clone(&self) -> AttachmentFormattingStyle
fn clone(&self) -> AttachmentFormattingStyle
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 AttachmentFormattingStyle
impl Debug for AttachmentFormattingStyle
Source§impl Default for AttachmentFormattingStyle
impl Default for AttachmentFormattingStyle
Source§fn default() -> AttachmentFormattingStyle
fn default() -> AttachmentFormattingStyle
Returns the “default value” for a type. Read more
impl Copy for AttachmentFormattingStyle
Auto Trait Implementations§
impl Freeze for AttachmentFormattingStyle
impl RefUnwindSafe for AttachmentFormattingStyle
impl Send for AttachmentFormattingStyle
impl Sync for AttachmentFormattingStyle
impl Unpin for AttachmentFormattingStyle
impl UnwindSafe for AttachmentFormattingStyle
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