pub struct Spanning<T, Sp = Span> {
pub item: T,
pub span: Sp,
}
Expand description
Data structure used to wrap items into a Span
.
Fields§
§item: T
Wrapped item.
span: Sp
Span
of the wrapped item.
Implementations§
Source§impl<T> Spanning<T, Span>
impl<T> Spanning<T, Span>
Sourcepub fn start(&self) -> SourcePosition
pub fn start(&self) -> SourcePosition
Returns start position of the item.
Sourcepub fn end(&self) -> SourcePosition
pub fn end(&self) -> SourcePosition
Returns end position of the item.
NOTE: This points to the first source position after the item.
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)>
Returns 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 From<Spanning<ParseError>> for GraphQLError
impl From<Spanning<ParseError>> for GraphQLError
Source§fn from(err: Spanning<ParseError>) -> Self
fn from(err: Spanning<ParseError>) -> Self
Converts to this type from the input type.
Source§impl Serialize for Spanning<ParseError>
impl Serialize for Spanning<ParseError>
impl<T: Copy, Sp: Copy> Copy for Spanning<T, Sp>
impl<T: Eq, Sp: Eq> Eq for Spanning<T, Sp>
impl<T, Sp> StructuralPartialEq for Spanning<T, Sp>
Auto Trait Implementations§
impl<T, Sp> Freeze for Spanning<T, Sp>
impl<T, Sp> RefUnwindSafe for Spanning<T, Sp>where
T: RefUnwindSafe,
Sp: RefUnwindSafe,
impl<T, Sp> Send for Spanning<T, Sp>
impl<T, Sp> Sync for Spanning<T, Sp>
impl<T, Sp> Unpin for Spanning<T, Sp>
impl<T, Sp> UnwindSafe for Spanning<T, Sp>where
T: UnwindSafe,
Sp: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.