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.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Title<'a>
impl<'a> RefUnwindSafe for Title<'a>
impl<'a> Send for Title<'a>
impl<'a> Sync for Title<'a>
impl<'a> Unpin for Title<'a>
impl<'a> UnwindSafe for Title<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more