pub enum AttachmentFormattingPlacement {
Inline,
InlineWithHeader {
header: &'static str,
},
Appendix {
appendix_name: &'static str,
},
Opaque,
Hidden,
}Expand description
Specifies where an attachment should be placed when displayed in a report.
This enum allows attachments to indicate their preferred placement in error reports. Different placements are suitable for different types of content:
- Inline: Short, contextual information that flows with the error message
- InlineWithHeader: Multi-line content that needs a header for clarity
- Appendix: Large or detailed content better suited to a separate section
- Opaque: Content that shouldn’t be shown but should be counted
- Hidden: Content that shouldn’t appear at all
The actual formatting system may or may not respect these preferences depending on the implementation.
§Examples
use rootcause_internals::handlers::AttachmentFormattingPlacement;
// Default is inline
let inline = AttachmentFormattingPlacement::default();
assert_eq!(inline, AttachmentFormattingPlacement::Inline);
// Attachment with header
let with_header = AttachmentFormattingPlacement::InlineWithHeader {
header: "Request Details",
};
// Large content in appendix
let appendix = AttachmentFormattingPlacement::Appendix {
appendix_name: "Full Stack Trace",
};
// Sensitive data that should be hidden
let hidden = AttachmentFormattingPlacement::Hidden;Variants§
Inline
Display the attachment inline with the error message.
Suitable for short, contextual information that naturally flows with the error text. This is the default placement.
InlineWithHeader
Display the attachment inline but preceded by a header.
Useful for multi-line content that benefits from a descriptive header, such as configuration snippets or multi-field data structures.
Appendix
Display the attachment in a separate appendix section.
Suitable for large or detailed content that would disrupt the flow of the main error message, such as full stack traces, large data dumps, or detailed diagnostic information.
Opaque
Don’t display the attachment, but count it in a summary.
The attachment won’t be shown directly, but may appear in a message like “3 additional opaque attachments”. Useful for numerous low-priority attachments that would clutter the output.
Hidden
Don’t display the attachment at all.
The attachment is completely hidden and won’t appear in any form. Useful for sensitive data that should be excluded from error reports, or for attachments meant only for programmatic access.
Trait Implementations§
Source§impl Clone for AttachmentFormattingPlacement
impl Clone for AttachmentFormattingPlacement
Source§fn clone(&self) -> AttachmentFormattingPlacement
fn clone(&self) -> AttachmentFormattingPlacement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for AttachmentFormattingPlacement
impl Default for AttachmentFormattingPlacement
Source§fn default() -> AttachmentFormattingPlacement
fn default() -> AttachmentFormattingPlacement
Source§impl Hash for AttachmentFormattingPlacement
impl Hash for AttachmentFormattingPlacement
Source§impl PartialEq for AttachmentFormattingPlacement
impl PartialEq for AttachmentFormattingPlacement
Source§fn eq(&self, other: &AttachmentFormattingPlacement) -> bool
fn eq(&self, other: &AttachmentFormattingPlacement) -> bool
self and other values to be equal, and is used by ==.