Struct Spanned
pub struct Spanned<T> { /* private fields */ }
A spanned value, indicating the range at which it is defined in the source.
Implementations
impl<T> Spanned<T>
fn new(range: Range<usize>, value: T) -> SelfCreate a spanned value encompassing the given byte range.
Example
Transposing a
Spanned<Enum<T>>intoEnum<Spanned<T>>:use ; use UntaggedEnumVisitor; use Spanned; # # type DetailedDependency = BTreeMap;fn span(&self) -> Range<usize>Byte range
fn into_inner(self) -> TConsumes the spanned value and returns the contained value.
fn get_ref(&self) -> &TReturns a reference to the contained value.
fn get_mut(&mut self) -> &mut TReturns a mutable reference to the contained value.
Trait Implementations
impl Borrow<str> for Spanned<Cow<'_, str>>
fn borrow(&self) -> &str
impl Borrow<str> for Spanned<String>
fn borrow(&self) -> &str
impl<'de, T> Deserialize<'de> for Spanned<T>
where
T: Deserialize<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de>,
impl<T> AsMut<T> for Spanned<T>
fn as_mut(&mut self) -> &mut T
impl<T> AsRef<T> for Spanned<T>
fn as_ref(&self) -> &T
impl<T: Clone> Clone for Spanned<T>
fn clone(&self) -> Spanned<T>
impl<T: Debug> Debug for Spanned<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T: Display> Display for Spanned<T>
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result
impl<T: Eq> Eq for Spanned<T>
impl<T: Hash> Hash for Spanned<T>
fn hash<H: Hasher>(&self, state: &mut H)
impl<T: Ord> Ord for Spanned<T>
fn cmp(&self, other: &Self) -> Ordering
impl<T: PartialEq> PartialEq for Spanned<T>
fn eq(&self, other: &Self) -> bool
impl<T: PartialOrd> PartialOrd for Spanned<T>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
impl<T: Serialize> Serialize for Spanned<T>
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer,
Auto Trait Implementations
impl<T> Freeze for Spanned<T>
where
T: Freeze,
impl<T> RefUnwindSafe for Spanned<T>
where
T: RefUnwindSafe,
impl<T> Send for Spanned<T>
where
T: Send,
impl<T> Sync for Spanned<T>
where
T: Sync,
impl<T> Unpin for Spanned<T>
where
T: Unpin,
impl<T> UnsafeUnpin for Spanned<T>
where
T: UnsafeUnpin,
impl<T> UnwindSafe for Spanned<T>
where
T: UnwindSafe,
Blanket Implementations
impl<T> Any for Spanned<T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Spanned<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Spanned<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Spanned<T>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> DeserializeOwned for Spanned<T>
where
T: for<'de> Deserialize<'de>,
impl<T> From<T> for Spanned<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Spanned<T>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Spanned<T>
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Spanned<T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Spanned<T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Spanned<T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>