pub trait MessageBase {
// Required methods
fn message_title(&self) -> Cow<'_, str>;
fn main_annotation(&self) -> Annotation<'_>;
// Provided methods
fn message_type(&self) -> AnnotationType { ... }
fn additional_annotations<'a, T: Extend<Annotation<'a>>>(
&'a self,
results: &mut T,
) { ... }
fn footers(&self) -> Vec<Footer<'_>> { ... }
}
๐Deprecated since 0.16.0: Use
Report
insteadExpand description
Helper for constructing a Message
Thanks to the blanket implementation impl<'a, T: MessageBase> From<&'a T> for Message<'a>
, implementors of this trait can be converted to a message
for free.
Required Methodsยง
Sourcefn message_title(&self) -> Cow<'_, str>
๐Deprecated since 0.16.0: Use Report
instead
fn message_title(&self) -> Cow<'_, str>
Report
insteadReturns the main caption of the message.
Sourcefn main_annotation(&self) -> Annotation<'_>
๐Deprecated since 0.16.0: Use Report
instead
fn main_annotation(&self) -> Annotation<'_>
Report
insteadReturns an annotation to be the first in the message.
Provided Methodsยง
Sourcefn message_type(&self) -> AnnotationType
๐Deprecated since 0.16.0: Use Report
instead
fn message_type(&self) -> AnnotationType
Report
insteadReturns the type of the entire message.
The default implementation returns AnnotationType::Error
.
Sourcefn additional_annotations<'a, T: Extend<Annotation<'a>>>(
&'a self,
results: &mut T,
)
๐Deprecated since 0.16.0: Use Report
instead
fn additional_annotations<'a, T: Extend<Annotation<'a>>>( &'a self, results: &mut T, )
Report
insteadAdds additional annotations to the given container.
The default implementation does nothing.
๐Deprecated since 0.16.0: Use Report
instead
Report
insteadReturns footers that are included in the message.
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.