[][src]Struct async_graphql_parser::Positioned

pub struct Positioned<T: ?Sized> {
    pub pos: Pos,
    pub node: T,
}

An AST node that stores its original position.

Fields

pos: Pos

The position of the node.

node: T

The node itself.

Implementations

impl<T> Positioned<T>[src]

#[must_use]pub const fn new(node: T, pos: Pos) -> Positioned<T>[src]

Create a new positioned node from the node and its position.

pub fn into_inner(self) -> T[src]

Get the inner node.

This is most useful in callback chains where Positioned::into_inner is easier to read than |positioned| positioned.node.

#[must_use]pub fn position_node<U>(&self, other: U) -> Positioned<U>[src]

Create a new positioned node with the same position as this one.

#[must_use]pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Positioned<U>[src]

Map the inner value of this positioned node.

Trait Implementations

impl Borrow<str> for Positioned<String>[src]

impl BorrowMut<str> for Positioned<String>[src]

impl<T: Clone + ?Sized> Clone for Positioned<T>[src]

impl<T: Copy + ?Sized> Copy for Positioned<T>[src]

impl<T: Debug + ?Sized> Debug for Positioned<T>[src]

impl<T: Default + ?Sized> Default for Positioned<T>[src]

impl<T: Display> Display for Positioned<T>[src]

impl<T: Eq> Eq for Positioned<T>[src]

impl<T: Hash> Hash for Positioned<T>[src]

impl<T: Ord> Ord for Positioned<T>[src]

impl<T: PartialEq> PartialEq<Positioned<T>> for Positioned<T>[src]

impl<T: PartialOrd> PartialOrd<Positioned<T>> for Positioned<T>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RuleType for T where
    T: Eq + Ord + Copy + Debug + Hash
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.