pub struct Spanning<T> {
pub item: T,
pub start: SourcePosition,
pub end: SourcePosition,
}
Expand description
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.
Implementations§
Trait Implementations§
source§impl<T: Error> Error for Spanning<T>
impl<T: Error> Error for Spanning<T>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<'a> From<Spanning<ParseError<'a>>> for GraphQLError<'a>
impl<'a> From<Spanning<ParseError<'a>>> for GraphQLError<'a>
source§fn from(f: Spanning<ParseError<'a>>) -> GraphQLError<'a>
fn from(f: Spanning<ParseError<'a>>) -> GraphQLError<'a>
Converts to this type from the input type.
source§impl<T: PartialEq> PartialEq<Spanning<T>> for Spanning<T>
impl<T: PartialEq> PartialEq<Spanning<T>> for Spanning<T>
source§impl<'a> Serialize for Spanning<ParseError<'a>>
impl<'a> Serialize for Spanning<ParseError<'a>>
impl<T: Copy> Copy for Spanning<T>
impl<T: Eq> Eq for Spanning<T>
impl<T> StructuralEq for Spanning<T>
impl<T> StructuralPartialEq for Spanning<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Spanning<T>where
T: RefUnwindSafe,
impl<T> Send for Spanning<T>where
T: Send,
impl<T> Sync for Spanning<T>where
T: Sync,
impl<T> Unpin for Spanning<T>where
T: Unpin,
impl<T> UnwindSafe for Spanning<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.