pub struct Label {
pub style: LabelStyle,
pub span: Span,
pub message: String,
}
Fields§
§style: LabelStyle
§span: Span
§message: String
Implementations§
source§impl Label
impl Label
sourcepub fn primary<S>(span: Span, message: S) -> Labelwhere
S: Into<String>,
pub fn primary<S>(span: Span, message: S) -> Labelwhere S: Into<String>,
Create a primary label with the given message. This will underline the
given span with carets (^^^^
).
sourcepub fn secondary<S>(span: Span, message: S) -> Labelwhere
S: Into<String>,
pub fn secondary<S>(span: Span, message: S) -> Labelwhere S: Into<String>,
Create a secondary label with the given message. This will underline the
given span with hyphens (----
).
sourcepub fn into_cs_label(self) -> Label<SourceFileId>
pub fn into_cs_label(self) -> Label<SourceFileId>
Convert into a [codespan_reporting::Diagnostic::Label
]
Trait Implementations§
source§impl PartialEq for Label
impl PartialEq for Label
impl Eq for Label
impl StructuralEq for Label
impl StructuralPartialEq for Label
Auto Trait Implementations§
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnwindSafe for Label
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.