Struct codespan_derive::Label [−][src]
pub struct Label<FileId> {
pub style: LabelStyle,
pub file_id: FileId,
pub range: Range<usize>,
pub message: String,
}Expand description
A label describing an underlined region of code associated with a diagnostic.
Fields
style: LabelStyleThe style of the label.
file_id: FileIdThe file that we are labelling.
range: Range<usize>The range in bytes we are going to include in the final snippet.
message: StringAn optional message to provide some additional information for the underlined code. These should not include line breaks.
Implementations
Create a new label.
Create a new label with a style of LabelStyle::Primary.
Create a new label with a style of LabelStyle::Secondary.
Add a message to the diagnostic.
Trait Implementations
Auto Trait Implementations
impl<FileId> RefUnwindSafe for Label<FileId> where
FileId: RefUnwindSafe,
impl<FileId> UnwindSafe for Label<FileId> where
FileId: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more