Struct juniper::parser::Spanning [−][src]
pub struct Spanning<T: Debug> { pub item: T, pub start: SourcePosition, pub end: SourcePosition, }
Data structure used to wrap items with start and end markers in the input source
A "span" is a range of characters in the input source, starting at the
character pointed by the start
field and ending just before the end
marker.
Fields
item: T
The wrapped item
start: SourcePosition
Start position of the item
end: SourcePosition
End position of the item
This points to the first source position after the wrapped item.
Methods
impl<T: Debug> Spanning<T>
[src]
impl<T: Debug> Spanning<T>
pub fn map<O: Debug, F: Fn(T) -> O>(self, f: F) -> Spanning<O>
[src]
pub fn map<O: Debug, F: Fn(T) -> O>(self, f: F) -> Spanning<O>
Modify the contents of the spanned item
Trait Implementations
impl<T: Debug + Debug> Debug for Spanning<T>
[src]
impl<T: Debug + Debug> Debug for Spanning<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Clone for Spanning<T> where
T: Clone + Debug,
[src]
impl<T> Clone for Spanning<T> where
T: Clone + Debug,
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> PartialEq for Spanning<T> where
T: PartialEq + Debug,
[src]
impl<T> PartialEq for Spanning<T> where
T: PartialEq + Debug,
fn eq(&self, other: &Self) -> bool
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T> Eq for Spanning<T> where
T: Eq + Debug,
[src]
impl<T> Eq for Spanning<T> where
T: Eq + Debug,
impl<T> Hash for Spanning<T> where
T: Hash + Debug,
[src]
impl<T> Hash for Spanning<T> where
T: Hash + Debug,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a> Serialize for Spanning<ParseError<'a>>
[src]
impl<'a> Serialize for Spanning<ParseError<'a>>
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'a> From<Spanning<ParseError<'a>>> for GraphQLError<'a>
[src]
impl<'a> From<Spanning<ParseError<'a>>> for GraphQLError<'a>
fn from(f: Spanning<ParseError<'a>>) -> GraphQLError<'a>
[src]
fn from(f: Spanning<ParseError<'a>>) -> GraphQLError<'a>
Performs the conversion.