pub struct Message {
pub span: Option<Range<usize>>,
pub reason: Cow<'static, str>,
pub rule_id: &'static str,
pub source: &'static str,
}Expand description
A serializer or custom event producer diagnostic.
Static messages and identifiers require no allocation. A dynamically formatted
reason can be supplied with String::into. Spans are half-open byte ranges in
the source; consumers can derive line and column numbers when presenting them.
Fields§
§span: Option<Range<usize>>Source bytes associated with this diagnostic, when available.
reason: Cow<'static, str>Human-readable explanation.
rule_id: &'static strCategory of message.
source: &'static strNamespace of message.
Trait Implementations§
impl Eq for Message
Source§impl From<Message> for StreamError
impl From<Message> for StreamError
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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