use super::captured::*;
pub trait Attachments {
fn attachments(&self) -> impl Iterator<Item = &CapturedAttachment>;
fn attachments_of_type<'this, AttachmentT>(
&'this self,
) -> impl Iterator<Item = &'this AttachmentT>
where
AttachmentT: 'static,
{
self.attachments()
.filter_map(|attachment| attachment.downcast_ref())
}
fn attachment_of_type<AttachmentT>(&self) -> Option<&AttachmentT>
where
AttachmentT: 'static,
{
self.attachments_of_type().next()
}
}