pub struct DirectiveLocation<'src> {
pub kind: DirectiveLocationKind,
pub span: ByteSpan,
pub syntax: Option<Box<DirectiveLocationSyntax<'src>>>,
}Expand description
A directive location with its own span (unlike
graphql_parser which uses a plain enum).
See Directive Locations in the spec.
Fields§
§kind: DirectiveLocationKind§span: ByteSpan§syntax: Option<Box<DirectiveLocationSyntax<'src>>>Implementations§
Source§impl DirectiveLocation<'_>
impl DirectiveLocation<'_>
Sourcepub fn append_source(&self, sink: &mut String, source: Option<&str>)
pub fn append_source(&self, sink: &mut String, source: Option<&str>)
Sourcepub fn byte_span(&self) -> ByteSpan
pub fn byte_span(&self) -> ByteSpan
Returns this directive location’s byte-offset span within the source text.
The returned ByteSpan can be resolved to line/column
positions via source_span() or
ByteSpan::resolve().
Sourcepub fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
pub fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
Trait Implementations§
Source§impl AstNode for DirectiveLocation<'_>
impl AstNode for DirectiveLocation<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this directive location’s byte-offset span within the source text.
The returned ByteSpan can be resolved to line/column
positions via source_span() or
ByteSpan::resolve().
Source§fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
Source§impl<'src> Clone for DirectiveLocation<'src>
impl<'src> Clone for DirectiveLocation<'src>
Source§fn clone(&self) -> DirectiveLocation<'src>
fn clone(&self) -> DirectiveLocation<'src>
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<'src> Debug for DirectiveLocation<'src>
impl<'src> Debug for DirectiveLocation<'src>
Source§impl<'src> PartialEq for DirectiveLocation<'src>
impl<'src> PartialEq for DirectiveLocation<'src>
impl<'src> StructuralPartialEq for DirectiveLocation<'src>
Auto Trait Implementations§
impl<'src> Freeze for DirectiveLocation<'src>
impl<'src> RefUnwindSafe for DirectiveLocation<'src>
impl<'src> Send for DirectiveLocation<'src>
impl<'src> Sync for DirectiveLocation<'src>
impl<'src> Unpin for DirectiveLocation<'src>
impl<'src> UnsafeUnpin for DirectiveLocation<'src>
impl<'src> UnwindSafe for DirectiveLocation<'src>
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