Struct source_span::Loc[][src]

pub struct Loc<T: ?Sized> { /* fields omitted */ }

Located data.

This is a simple wrapper around data that can be located in a source file. It is useful to wrap abstract syntax tree nodes.

It derefs into the inner value.

Implementations

impl<T: ?Sized> Loc<T>[src]

pub fn new(t: T, span: Span) -> Loc<T> where
    T: Sized
[src]

Associate a span location to some data by wrapping it under Loc.

pub fn span(&self) -> Span[src]

Get the span location of the data.

pub fn inner_into<U>(self) -> Loc<U> where
    T: Into<U>, 
[src]

Convert the inner value.

pub fn inner_try_into<U>(self) -> Result<Loc<U>, <T as TryInto<U>>::Error> where
    T: TryInto<U>, 
[src]

Try to convert the inner value.

pub fn into_inner(self) -> T where
    T: Sized
[src]

Unwrap the data.

pub fn into_raw_parts(self) -> (T, Span) where
    T: Sized
[src]

Break the wrapper into the value and its location.

Trait Implementations

impl<T> AsMut<T> for Loc<T>[src]

impl<T> AsRef<T> for Loc<T>[src]

impl<T: Clone> Clone for Loc<T>[src]

impl<T: Debug> Debug for Loc<T>[src]

impl<T> Deref for Loc<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Loc<T>[src]

impl<T: Display> Display for Loc<T>[src]

impl<T: Eq> Eq for Loc<T>[src]

impl<T: Hash> Hash for Loc<T>[src]

impl<T: Ord> Ord for Loc<T>[src]

impl<T: PartialEq> PartialEq<Loc<T>> for Loc<T>[src]

impl<T: PartialOrd> PartialOrd<Loc<T>> for Loc<T>[src]

Auto Trait Implementations

impl<T: ?Sized> RefUnwindSafe for Loc<T> where
    T: RefUnwindSafe

impl<T: ?Sized> Send for Loc<T> where
    T: Send

impl<T: ?Sized> Sync for Loc<T> where
    T: Sync

impl<T: ?Sized> Unpin for Loc<T> where
    T: Unpin

impl<T: ?Sized> UnwindSafe for Loc<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.