pub struct Element {
pub id: ElemId,
pub span: Span,
pub path: SmartString,
}Expand description
A representation of a JSON element that satisfies the needs of most consumers of a Warning.
This representation avoids the complexity of needing to provide a 'buf lifetime to the json::Element.
This would complicate all warnings types with that lifetime.
A consumer of warnings wants to group them by json::ElemId using Warning::group_by_elem and then
display or report the warnings by path.
The linter report also wants to highlight the source JSON that a warning refers too.
Fields§
§id: ElemIdThe Id of the element that caused the Warning.
This is used for sorting warnings and can be used to retrieve the json::Element object.
span: SpanThe Span that delimits the json::Element.
path: SmartStringThe elements path.
Most consumers of warnings just want this data.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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