Struct async_graphql_parser::Positioned 
source · Expand description
An AST node that stores its original position.
Fields
pos: PosThe position of the node.
node: TThe node itself.
Implementations
sourceimpl<T> Positioned<T>
 
impl<T> Positioned<T>
sourcepub const fn new(node: T, pos: Pos) -> Positioned<T>
 
pub const fn new(node: T, pos: Pos) -> Positioned<T>
Create a new positioned node from the node and its position.
sourcepub fn into_inner(self) -> T
 
pub fn into_inner(self) -> T
Get the inner node.
This is most useful in callback chains where Positioned::into_inner is
easier to read than |positioned| positioned.node.
sourcepub fn position_node<U>(&self, other: U) -> Positioned<U>
 
pub fn position_node<U>(&self, other: U) -> Positioned<U>
Create a new positioned node with the same position as this one.
sourcepub fn map<U>(self, f: impl FnOnce(T) -> U) -> Positioned<U>
 
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Positioned<U>
Map the inner value of this positioned node.
Trait Implementations
sourceimpl Borrow<str> for Positioned<String>
 
impl Borrow<str> for Positioned<String>
sourceimpl BorrowMut<str> for Positioned<String>
 
impl BorrowMut<str> for Positioned<String>
sourcefn borrow_mut(&mut self) -> &mut str
 
fn borrow_mut(&mut self) -> &mut str
Mutably borrows from an owned value. Read more
sourceimpl<T: Clone + ?Sized> Clone for Positioned<T>
 
impl<T: Clone + ?Sized> Clone for Positioned<T>
sourcefn clone(&self) -> Positioned<T>
 
fn clone(&self) -> Positioned<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresourceimpl<T: Debug + ?Sized> Debug for Positioned<T>
 
impl<T: Debug + ?Sized> Debug for Positioned<T>
sourceimpl<T: Default + ?Sized> Default for Positioned<T>
 
impl<T: Default + ?Sized> Default for Positioned<T>
sourcefn default() -> Positioned<T>
 
fn default() -> Positioned<T>
Returns the “default value” for a type. Read more
sourceimpl<'de, T: ?Sized> Deserialize<'de> for Positioned<T>where
    T: Deserialize<'de>,
 
impl<'de, T: ?Sized> Deserialize<'de> for Positioned<T>where
    T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T: Display> Display for Positioned<T>
 
impl<T: Display> Display for Positioned<T>
sourceimpl<T: Hash> Hash for Positioned<T>
 
impl<T: Hash> Hash for Positioned<T>
sourceimpl<T: Ord> Ord for Positioned<T>
 
impl<T: Ord> Ord for Positioned<T>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn min(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
    Self: Sized + PartialOrd<Self>,
 
fn clamp(self, min: Self, max: Self) -> Selfwhere
    Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq> PartialEq<Positioned<T>> for Positioned<T>
 
impl<T: PartialEq> PartialEq<Positioned<T>> for Positioned<T>
sourceimpl<T: PartialOrd> PartialOrd<Positioned<T>> for Positioned<T>
 
impl<T: PartialOrd> PartialOrd<Positioned<T>> for Positioned<T>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
 
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moresourceimpl<T: ?Sized> Serialize for Positioned<T>where
    T: Serialize,
 
impl<T: ?Sized> Serialize for Positioned<T>where
    T: Serialize,
impl<T: Copy + ?Sized> Copy for Positioned<T>
impl<T: Eq> Eq for Positioned<T>
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Positioned<T>where
    T: RefUnwindSafe,
impl<T: ?Sized> Send for Positioned<T>where
    T: Send,
impl<T: ?Sized> Sync for Positioned<T>where
    T: Sync,
impl<T: ?Sized> Unpin for Positioned<T>where
    T: Unpin,
impl<T: ?Sized> UnwindSafe for Positioned<T>where
    T: UnwindSafe,
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
sourceimpl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
 
impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.