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
sourceimpl<T: Error> Error for Spanning<T>
impl<T: Error> Error for Spanning<T>
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl<'a> From<Spanning<ParseError<'a>>> for GraphQLError<'a>
impl<'a> From<Spanning<ParseError<'a>>> for GraphQLError<'a>
sourcefn from(f: Spanning<ParseError<'a>>) -> GraphQLError<'a>
fn from(f: Spanning<ParseError<'a>>) -> GraphQLError<'a>
Converts to this type from the input type.
sourceimpl<'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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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 Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
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.