Struct dynamic_graphql::Lookahead 
source · pub struct Lookahead<'a> { /* private fields */ }Expand description
A selection performed by a query.
Implementations§
source§impl<'a> Lookahead<'a>
 
impl<'a> Lookahead<'a>
sourcepub fn field(&self, name: &str) -> Lookahead<'a>
 
pub fn field(&self, name: &str) -> Lookahead<'a>
Get the field of the selection set with the specified name. This will ignore aliases.
For example, calling .field("a") on { a { b } } will return a
lookahead that represents { b }.
sourcepub fn selection_fields(&self) -> Vec<SelectionField<'a>, Global> ⓘ
 
pub fn selection_fields(&self) -> Vec<SelectionField<'a>, Global> ⓘ
Get the SelectionFields for each of the fields covered by this
Lookahead.
There will be multiple fields in situations where the same field is queried twice.
Trait Implementations§
source§impl<'a> From<SelectionField<'a>> for Lookahead<'a>
 
impl<'a> From<SelectionField<'a>> for Lookahead<'a>
source§fn from(selection_field: SelectionField<'a>) -> Lookahead<'a>
 
fn from(selection_field: SelectionField<'a>) -> Lookahead<'a>
Converts to this type from the input type.
source§impl<'a> TryFrom<&[SelectionField<'a>]> for Lookahead<'a>
 
impl<'a> TryFrom<&[SelectionField<'a>]> for Lookahead<'a>
Convert a slice of SelectionFields to a Lookahead.
Assumes all SelectionFields are from the same query and thus have the same
fragments.
Fails if either no SelectionFields were provided.