pub trait AttachmentsMutwhere
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§
Sourcefn attachments_mut(&mut self) -> impl Iterator<Item = &mut CapturedAttachment>
fn attachments_mut(&mut self) -> impl Iterator<Item = &mut CapturedAttachment>
Iterate attachments.
Provided Methods§
Sourcefn attachments_of_type_mut<'this, AttachmentT>(
&'this mut self,
) -> impl Iterator<Item = &'this mut AttachmentT>where
AttachmentT: 'static,
fn attachments_of_type_mut<'this, AttachmentT>(
&'this mut self,
) -> impl Iterator<Item = &'this mut AttachmentT>where
AttachmentT: 'static,
Iterate attachments of a type.
Sourcefn attachment_of_type_mut<AttachmentT>(&mut self) -> Option<&mut AttachmentT>where
AttachmentT: 'static,
fn attachment_of_type_mut<AttachmentT>(&mut self) -> Option<&mut AttachmentT>where
AttachmentT: 'static,
First attachment of a type.
Sourcefn must_attachment_of_type_mut<AttachmentT, DefaultT>(
&mut self,
default: DefaultT,
) -> &mut AttachmentT
fn must_attachment_of_type_mut<AttachmentT, DefaultT>( &mut self, default: DefaultT, ) -> &mut AttachmentT
First attachment of a type.
If an attachment of the type is not found then a default will be attached.
Sourcefn attach_once<AttachmentT>(&mut self, attachment: AttachmentT)
fn attach_once<AttachmentT>(&mut self, attachment: AttachmentT)
Add an attachment only if we don’t already have one of its type.
Sourcefn attach_location_once(&mut self)
fn attach_location_once(&mut self)
Add a Location (via Location::caller) attachment if we don’t already have one.
Sourcefn attach_backtrace_once(&mut self)
Available on crate feature backtrace-external only.
fn attach_backtrace_once(&mut self)
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.