[−][src]Struct codespan_reporting::diagnostic::Label
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
impl<FileId> Label<FileId>[src]
pub fn new(
style: LabelStyle,
file_id: FileId,
range: impl Into<Range<usize>>
) -> Label<FileId>[src]
style: LabelStyle,
file_id: FileId,
range: impl Into<Range<usize>>
) -> Label<FileId>
Create a new label.
pub fn primary(file_id: FileId, range: impl Into<Range<usize>>) -> Label<FileId>[src]
Create a new label with a style of LabelStyle::Primary.
pub fn secondary(
file_id: FileId,
range: impl Into<Range<usize>>
) -> Label<FileId>[src]
file_id: FileId,
range: impl Into<Range<usize>>
) -> Label<FileId>
Create a new label with a style of LabelStyle::Secondary.
pub fn with_message(self, message: impl Into<String>) -> Label<FileId>[src]
Add a message to the diagnostic.
Trait Implementations
impl<FileId: Clone> Clone for Label<FileId>[src]
impl<FileId: Debug> Debug for Label<FileId>[src]
impl<FileId: Eq> Eq for Label<FileId>[src]
impl<FileId: PartialEq> PartialEq<Label<FileId>> for Label<FileId>[src]
pub fn eq(&self, other: &Label<FileId>) -> bool[src]
pub fn ne(&self, other: &Label<FileId>) -> bool[src]
impl<FileId> StructuralEq for Label<FileId>[src]
impl<FileId> StructuralPartialEq for Label<FileId>[src]
Auto Trait Implementations
impl<FileId> RefUnwindSafe for Label<FileId> where
FileId: RefUnwindSafe,
FileId: RefUnwindSafe,
impl<FileId> Send for Label<FileId> where
FileId: Send,
FileId: Send,
impl<FileId> Sync for Label<FileId> where
FileId: Sync,
FileId: Sync,
impl<FileId> Unpin for Label<FileId> where
FileId: Unpin,
FileId: Unpin,
impl<FileId> UnwindSafe for Label<FileId> where
FileId: UnwindSafe,
FileId: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,