pub struct Title<'a> { /* private fields */ }Expand description
A title that introduces a Group, describing the main point
To create a Title, see Level::primary_title or Level::secondary_title.
§Example
let report = &[
Group::with_title(
Level::ERROR.primary_title("mismatched types").id("E0308")
),
Group::with_title(
Level::HELP.secondary_title("function defined here")
),
];Implementations§
Source§impl<'a> Title<'a>
impl<'a> Title<'a>
Sourcepub fn id(self, id: impl Into<Cow<'a, str>>) -> Self
pub fn id(self, id: impl Into<Cow<'a, str>>) -> Self
The category for this Report
Useful for looking searching for more information to resolve the diagnostic.
Text passed to this function is considered “untrusted input”, as such all text is passed through a normalization function. Styled text is not allowed to be passed to this function.
Sourcepub fn id_url(self, url: impl Into<Cow<'a, str>>) -> Self
pub fn id_url(self, url: impl Into<Cow<'a, str>>) -> Self
Provide a URL for Title::id for more information on this diagnostic
This is only relevant if id is present
Sourcepub fn footnote(self, marker: impl Into<OptionCow<'a>>) -> Self
pub fn footnote(self, marker: impl Into<OptionCow<'a>>) -> Self
Append a footnote marker to the title
The caller is responsible for rendering the footnote.
Text passed to this function is considered “untrusted input”, as such all text is passed through a normalization function. Styled text is not allowed to be passed to this function.