pub enum Selection<'src> {
Field(FieldSelection<'src>),
FragmentSpread(FragmentSpread<'src>),
InlineFragment(InlineFragment<'src>),
}Expand description
A single selection within a selection set.
See Selection Sets in the spec.
Variants§
Field(FieldSelection<'src>)
FragmentSpread(FragmentSpread<'src>)
InlineFragment(InlineFragment<'src>)
Implementations§
Source§impl<'src> Selection<'src>
impl<'src> Selection<'src>
Sourcepub fn directive_annotations(&self) -> &[DirectiveAnnotation<'src>]
pub fn directive_annotations(&self) -> &[DirectiveAnnotation<'src>]
Returns the directive annotations applied to this selection.
Sourcepub fn name(&self) -> Option<&Name<'src>>
pub fn name(&self) -> Option<&Name<'src>>
Returns the name of this selection, or None for
inline fragments (which have no name).
Sourcepub fn name_value(&self) -> Option<&str>
pub fn name_value(&self) -> Option<&str>
Returns the name of this selection as a string slice,
or None for inline fragments.
Convenience accessor for self.name().value.
Source§impl Selection<'_>
impl Selection<'_>
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 selection’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 Selection<'_>
impl AstNode for Selection<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this selection’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>
impl<'src> StructuralPartialEq for Selection<'src>
Auto Trait Implementations§
impl<'src> Freeze for Selection<'src>
impl<'src> RefUnwindSafe for Selection<'src>
impl<'src> Send for Selection<'src>
impl<'src> Sync for Selection<'src>
impl<'src> Unpin for Selection<'src>
impl<'src> UnsafeUnpin for Selection<'src>
impl<'src> UnwindSafe for Selection<'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