pub enum Selection<'a> {
Field(Field<'a>),
FragmentSpread(FragmentSpread<'a>),
InlineFragment(InlineFragment<'a>),
}
Expand description
AST Node of a selection as contained inside a SelectionSet
.
Any given Selection Set may contain fields, fragment spread, and inline fragments. Reference
Variants§
Implementations§
Source§impl<'a> Selection<'a>
impl<'a> Selection<'a>
Sourcepub fn field(&'a self) -> Option<&'a Field<'a>>
pub fn field(&'a self) -> Option<&'a Field<'a>>
Helper method to return the Field
if the Selection is a Field
.
Sourcepub fn fragment_spread(&'a self) -> Option<&'a FragmentSpread<'a>>
pub fn fragment_spread(&'a self) -> Option<&'a FragmentSpread<'a>>
Helper method to return the FragmentSpread
if the Selection is a FragmentSpread
.
Sourcepub fn inline_fragment(&'a self) -> Option<&'a InlineFragment<'a>>
pub fn inline_fragment(&'a self) -> Option<&'a InlineFragment<'a>>
Helper method to return the InlineFragment
if the Selection is an InlineFragment
.
Trait Implementations§
Source§impl<'a> From<FragmentSpread<'a>> for Selection<'a>
impl<'a> From<FragmentSpread<'a>> for Selection<'a>
Source§fn from(x: FragmentSpread<'a>) -> Self
fn from(x: FragmentSpread<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<InlineFragment<'a>> for Selection<'a>
impl<'a> From<InlineFragment<'a>> for Selection<'a>
Source§fn from(x: InlineFragment<'a>) -> Self
fn from(x: InlineFragment<'a>) -> Self
Converts to this type from the input type.
Source§impl<'arena> WithDirectives<'arena> for Selection<'arena>
impl<'arena> WithDirectives<'arena> for Selection<'arena>
Source§fn directives(&self) -> &Directives<'arena>
fn directives(&self) -> &Directives<'arena>
Helper method to get all Directives for a given selection directly.
Any selection AST node may carry Directives, so when those are checked it’s unnecessary to first match the type of selection.
impl<'a> StructuralPartialEq for Selection<'a>
Auto Trait Implementations§
impl<'a> Freeze for Selection<'a>
impl<'a> !RefUnwindSafe for Selection<'a>
impl<'a> !Send for Selection<'a>
impl<'a> !Sync for Selection<'a>
impl<'a> Unpin for Selection<'a>
impl<'a> !UnwindSafe for Selection<'a>
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