Struct gluon_base::pos::Spanned

source ·
pub struct Spanned<T, Pos> {
    pub span: Span<Pos>,
    pub value: T,
}

Fields§

§span: Span<Pos>§value: T

Implementations§

source§

impl<T, Pos> Spanned<T, Pos>

source

pub fn map<U, F>(self, f: F) -> Spanned<U, Pos>
where F: FnMut(T) -> U,

Trait Implementations§

source§

impl<E> AsDiagnostic for Spanned<E, BytePos>
where E: AsDiagnostic,

source§

fn as_diagnostic(&self, map: &CodeMap) -> Diagnostic<FileId>

source§

impl<T, Pos> AsId<T> for Spanned<T, Pos>

source§

fn as_id(&self) -> &T

source§

impl<'ast, Id> AsMut<Spanned<Type<Id, AstType<'ast, Id>>, ByteIndex>> for AstType<'ast, Id>

source§

fn as_mut(&mut self) -> &mut SpannedAstType<'ast, Id>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, U, Pos> AsRef<U> for Spanned<T, Pos>
where T: AsRef<U>, U: ?Sized,

source§

fn as_ref(&self) -> &U

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'ast, Id, T, P> AstClone<'ast, Id> for Spanned<T, P>
where T: AstClone<'ast, Id>, P: Clone,

source§

fn ast_clone(&self, arena: ArenaRef<'_, 'ast, Id>) -> Self

source§

impl<T: Clone, Pos: Clone> Clone for Spanned<T, Pos>

source§

fn clone(&self) -> Spanned<T, Pos>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug, Pos: Debug> Debug for Spanned<T, Pos>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default, Pos: Default> Default for Spanned<T, Pos>

source§

fn default() -> Spanned<T, Pos>

Returns the “default value” for a type. Read more
source§

impl<T, Pos> Deref for Spanned<T, Pos>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T, Pos> DerefMut for Spanned<T, Pos>

source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
source§

impl<T: Display, Pos: Display + Copy> Display for Spanned<T, Pos>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, Pos> From<(T, Span<Pos>)> for Spanned<T, Pos>

source§

fn from((value, span): (T, Span<Pos>)) -> Self

Converts to this type from the input type.
source§

impl<P> From<Spanned<Symbol, P>> for Symbol

source§

fn from(s: Spanned<Symbol, P>) -> Self

Converts to this type from the input type.
source§

impl<T, Pos> From<T> for Spanned<T, Pos>
where Pos: Default,

source§

fn from(value: T) -> Self

Converts to this type from the input type.
source§

impl<T, Pos> Hash for Spanned<T, Pos>
where T: Hash, Pos: Hash + Copy,

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T, Pos> PartialEq<T> for Spanned<T, Pos>
where T: PartialEq,

source§

fn eq(&self, other: &T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialEq, Pos: PartialEq> PartialEq for Spanned<T, Pos>

source§

fn eq(&self, other: &Spanned<T, Pos>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Typed> Typed for Spanned<T, BytePos>

§

type Ident = <T as Typed>::Ident

source§

fn try_type_of( &self, env: &dyn TypeEnv<Type = ArcType> ) -> Result<ArcType<T::Ident>, String>

source§

fn env_type_of(&self, env: &dyn TypeEnv<Type = ArcType>) -> ArcType<Self::Ident>

source§

impl<T: Copy, Pos: Copy> Copy for Spanned<T, Pos>

source§

impl<T: Eq, Pos: Eq> Eq for Spanned<T, Pos>

source§

impl<T, Pos> StructuralEq for Spanned<T, Pos>

source§

impl<T, Pos> StructuralPartialEq for Spanned<T, Pos>

Auto Trait Implementations§

§

impl<T, Pos> RefUnwindSafe for Spanned<T, Pos>

§

impl<T, Pos> Send for Spanned<T, Pos>
where Pos: Send, T: Send,

§

impl<T, Pos> Sync for Spanned<T, Pos>
where Pos: Sync, T: Sync,

§

impl<T, Pos> Unpin for Spanned<T, Pos>
where Pos: Unpin, T: Unpin,

§

impl<T, Pos> UnwindSafe for Spanned<T, Pos>
where Pos: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<Id> AsId<Id> for Id
where Id: ?Sized,

source§

fn as_id(&self) -> &Id

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Any for T
where T: Any,

§

impl<T> CloneAny for T
where T: Any + Clone,