AttachmentHandler

Trait AttachmentHandler 

Source
pub trait AttachmentHandler<A>: 'static {
    // Required methods
    fn display(value: &A, formatter: &mut Formatter<'_>) -> Result;
    fn debug(value: &A, formatter: &mut Formatter<'_>) -> Result;

    // Provided method
    fn preferred_formatting_style(
        value: &A,
        report_formatting_function: FormattingFunction,
    ) -> AttachmentFormattingStyle { ... }
}
Expand description

Handler used to implement or override the behavior of core::fmt::Display and core::fmt::Debug when creating an attachment.

Required Methods§

Source

fn display(value: &A, formatter: &mut Formatter<'_>) -> Result

The function used when calling RawAttachmentRef::attachment_display

Source

fn debug(value: &A, formatter: &mut Formatter<'_>) -> Result

The function used when calling RawAttachmentRef::attachment_debug

Provided Methods§

Source

fn preferred_formatting_style( value: &A, report_formatting_function: FormattingFunction, ) -> AttachmentFormattingStyle

The function used when calling RawAttachmentRef::preferred_formatting_style

The formatting style preferred by the attachment when formatted as part of a report.

§Arguments
  • report_formatting_function: Whether the report in which this attachment will be embedded is being formatted using Display formatting or Debug

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§