Skip to main content

PreformatAttachmentExt

Trait PreformatAttachmentExt 

Source
pub trait PreformatAttachmentExt {
    // Required method
    fn preformat(&self) -> ReportAttachment<PreformattedAttachment, SendSync>;
}
Expand description

Extension trait providing preformat on ReportAttachment, ReportAttachmentRef, and ReportAttachmentMut.

§Examples

use rootcause::report_attachment::ReportAttachment;
use rootcause_preformat::PreformatAttachmentExt;

let attachment = ReportAttachment::new_sendsync(42i32);
let preformatted = attachment.preformat();
assert_eq!(
    attachment.format_inner().to_string(),
    preformatted.format_inner().to_string()
);

Required Methods§

Source

fn preformat(&self) -> ReportAttachment<PreformattedAttachment, SendSync>

Creates a new attachment, with the inner attachment data preformatted.

This can be useful, as the preformatted attachment is a newly allocated object and additionally is Send+Sync.

See PreformattedAttachment for more information.

§Examples
use rootcause::report_attachment::ReportAttachment;
use rootcause_preformat::PreformatAttachmentExt;

let attachment = ReportAttachment::new_sendsync(42i32);
let preformatted = attachment.preformat();

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, A: ?Sized> PreformatAttachmentExt for ReportAttachmentMut<'a, A>

Source§

impl<'a, A: ?Sized> PreformatAttachmentExt for ReportAttachmentRef<'a, A>

Source§

impl<A: ?Sized, T> PreformatAttachmentExt for ReportAttachment<A, T>

Implementors§