Struct ValLoc

Source
pub struct ValLoc<T> {
    pub location: Option<Location>,
    /* private fields */
}
Expand description

Value with location. Used in place of parsed values which need locations to report errors during semantic analysis.

Fields§

§location: Option<Location>

Implementations§

Source§

impl<T> ValLoc<T>

Source

pub fn new(value: T, location: Option<Location>) -> Self

Trait Implementations§

Source§

impl<T> AsRef<T> for ValLoc<T>

Source§

fn as_ref(&self) -> &T

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

impl<T: Clone> Clone for ValLoc<T>

Source§

fn clone(&self) -> ValLoc<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for ValLoc<T>

Source§

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

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

impl<T> Deref for ValLoc<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Display> Display for ValLoc<T>

Source§

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

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

impl From<&ValLoc<bool>> for bool
where bool: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<char>> for char
where char: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<f32>> for f32
where f32: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<f64>> for f64
where f64: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<i128>> for i128
where i128: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<i16>> for i16
where i16: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<i32>> for i32
where i32: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<i64>> for i64
where i64: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<i8>> for i8
where i8: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<isize>> for isize
where isize: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<u128>> for u128
where u128: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<u16>> for u16
where u16: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<u32>> for u32
where u32: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<u64>> for u64
where u64: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<u8>> for u8
where u8: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<&ValLoc<usize>> for usize
where usize: Copy,

Source§

fn from(value: &ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<T> for ValLoc<T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<String>> for String

Source§

fn from(value: ValLoc<String>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<bool>> for bool

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<char>> for char

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<f32>> for f32

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<f64>> for f64

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<i128>> for i128

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<i16>> for i16

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<i32>> for i32

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<i64>> for i64

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<i8>> for i8

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<isize>> for isize

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<u128>> for u128

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<u16>> for u16

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<u32>> for u32

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<u64>> for u64

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<u8>> for u8

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.
Source§

impl From<ValLoc<usize>> for usize

Source§

fn from(value: ValLoc<Self>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> Freeze for ValLoc<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ValLoc<T>
where T: RefUnwindSafe,

§

impl<T> Send for ValLoc<T>
where T: Send,

§

impl<T> Sync for ValLoc<T>
where T: Sync,

§

impl<T> Unpin for ValLoc<T>
where T: Unpin,

§

impl<T> UnwindSafe for ValLoc<T>
where 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<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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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§

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>,

Source§

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>,

Source§

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.