pub struct GraphQLErrorNote {
pub kind: GraphQLErrorNoteKind,
pub message: String,
pub span: Option<SourceSpan>,
}Expand description
An error note providing additional context about an error.
Notes augment the primary error message with:
- Explanatory context (why the error occurred)
- Actionable suggestions (how to fix it)
- Specification references (where to learn more)
- Related source locations (e.g., where a delimiter was opened)
Fields§
§kind: GraphQLErrorNoteKindThe kind of note (determines rendering prefix).
message: StringThe note message.
span: Option<SourceSpan>Optional pre-resolved span pointing to a related location.
When present, the note is rendered with a source snippet
pointing to this location. Like the primary error’s
source_span, this is eagerly resolved at error
construction time so it carries line/column/byte-offset
information without requiring a SourceMap at display time.
Implementations§
Source§impl GraphQLErrorNote
impl GraphQLErrorNote
Sourcepub fn general_with_span(message: impl Into<String>, span: SourceSpan) -> Self
pub fn general_with_span(message: impl Into<String>, span: SourceSpan) -> Self
Creates a general note with a pre-resolved span.
Sourcepub fn help_with_span(message: impl Into<String>, span: SourceSpan) -> Self
pub fn help_with_span(message: impl Into<String>, span: SourceSpan) -> Self
Creates a help note with a pre-resolved span.
Trait Implementations§
Source§impl Clone for GraphQLErrorNote
impl Clone for GraphQLErrorNote
Source§fn clone(&self) -> GraphQLErrorNote
fn clone(&self) -> GraphQLErrorNote
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphQLErrorNote
impl Debug for GraphQLErrorNote
Source§impl PartialEq for GraphQLErrorNote
impl PartialEq for GraphQLErrorNote
impl StructuralPartialEq for GraphQLErrorNote
Auto Trait Implementations§
impl Freeze for GraphQLErrorNote
impl RefUnwindSafe for GraphQLErrorNote
impl Send for GraphQLErrorNote
impl Sync for GraphQLErrorNote
impl Unpin for GraphQLErrorNote
impl UnsafeUnpin for GraphQLErrorNote
impl UnwindSafe for GraphQLErrorNote
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