Struct async_graphql::Lookahead
source · [−]pub struct Lookahead<'a> { /* private fields */ }
Expand description
A selection performed by a query.
Implementations
sourceimpl<'a> Lookahead<'a>
impl<'a> Lookahead<'a>
sourcepub fn field(&self, name: &str) -> Self
pub fn field(&self, name: &str) -> Self
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>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn selection_fields(&self) -> Vec<SelectionField<'a>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Get the SelectionField
s 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
sourceimpl<'a> From<SelectionField<'a>> for Lookahead<'a>
impl<'a> From<SelectionField<'a>> for Lookahead<'a>
sourcefn from(selection_field: SelectionField<'a>) -> Self
fn from(selection_field: SelectionField<'a>) -> Self
Converts to this type from the input type.
sourceimpl<'a> TryFrom<&[SelectionField<'a>]> for Lookahead<'a>
impl<'a> TryFrom<&[SelectionField<'a>]> for Lookahead<'a>
Convert a slice of SelectionField
s to a Lookahead
.
Assumes all SelectionField
s are from the same query and thus have the same
fragments.
Fails if either no SelectionField
s were provided.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Lookahead<'a>
impl<'a> Send for Lookahead<'a>
impl<'a> Sync for Lookahead<'a>
impl<'a> Unpin for Lookahead<'a>
impl<'a> !UnwindSafe for Lookahead<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more