[−][src]Struct async_graphql_parser::Positioned
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][−]
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
.
pub fn position_node<U>(&self, other: U) -> Positioned<U>
[src][−]
Create a new positioned node with the same position as this one.
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,
T: RefUnwindSafe,
impl<T: ?Sized> Send for Positioned<T> where
T: Send,
T: Send,
impl<T: ?Sized> Sync for Positioned<T> where
T: Sync,
T: Sync,
impl<T: ?Sized> Unpin for Positioned<T> where
T: Unpin,
T: Unpin,
impl<T: ?Sized> UnwindSafe for Positioned<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> RuleType for T where
T: Eq + Ord + Copy + Debug + Hash,
[src]
T: Eq + Ord + Copy + Debug + Hash,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,