Skip to main content

AttachmentsMut

Trait AttachmentsMut 

Source
pub trait AttachmentsMut
where Self: Attachments,
{ // Required methods fn attachments_mut( &mut self, ) -> impl Iterator<Item = &mut CapturedAttachment>; fn attach<AttachmentT>(&mut self, attachment: AttachmentT) where AttachmentT: 'static + Send + Sync; // Provided methods fn attachments_of_type_mut<'this, AttachmentT>( &'this mut self, ) -> impl Iterator<Item = &'this mut AttachmentT> where AttachmentT: 'static { ... } fn attachment_of_type_mut<AttachmentT>( &mut self, ) -> Option<&mut AttachmentT> where AttachmentT: 'static { ... } fn must_attachment_of_type_mut<AttachmentT, DefaultT>( &mut self, default: DefaultT, ) -> &mut AttachmentT where AttachmentT: 'static + Send + Sync, DefaultT: FnOnce() -> AttachmentT { ... } fn attach_once<AttachmentT>(&mut self, attachment: AttachmentT) where AttachmentT: 'static + Send + Sync { ... } fn attach_location_once(&mut self) { ... } fn attach_backtrace_once(&mut self) { ... } }
Expand description

Mutable access to attachments.

Required Methods§

Source

fn attachments_mut(&mut self) -> impl Iterator<Item = &mut CapturedAttachment>

Iterate attachments.

Source

fn attach<AttachmentT>(&mut self, attachment: AttachmentT)
where AttachmentT: 'static + Send + Sync,

Add an attachment.

Provided Methods§

Source

fn attachments_of_type_mut<'this, AttachmentT>( &'this mut self, ) -> impl Iterator<Item = &'this mut AttachmentT>
where AttachmentT: 'static,

Iterate attachments of a type.

Source

fn attachment_of_type_mut<AttachmentT>(&mut self) -> Option<&mut AttachmentT>
where AttachmentT: 'static,

First attachment of a type.

Source

fn must_attachment_of_type_mut<AttachmentT, DefaultT>( &mut self, default: DefaultT, ) -> &mut AttachmentT
where AttachmentT: 'static + Send + Sync, DefaultT: FnOnce() -> AttachmentT,

First attachment of a type.

If an attachment of the type is not found then a default will be attached.

Source

fn attach_once<AttachmentT>(&mut self, attachment: AttachmentT)
where AttachmentT: 'static + Send + Sync,

Add an attachment only if we don’t already have one of its type.

Source

fn attach_location_once(&mut self)

Add a Location (via Location::caller) attachment if we don’t already have one.

Source

fn attach_backtrace_once(&mut self)

Available on crate feature backtrace-external only.

Add a backtrace attachment if we don’t already have one.

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§