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]
impl<T: ?Sized> Loc<T>
[src]pub fn new(t: T, span: Span) -> Loc<T> where
T: Sized,
[src]
T: Sized,
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]
T: Into<U>,
Convert the inner value.
pub fn inner_try_into<U>(self) -> Result<Loc<U>, <T as TryInto<U>>::Error> where
T: TryInto<U>,
[src]
T: TryInto<U>,
Try to convert the inner value.
pub fn into_inner(self) -> T where
T: Sized,
[src]
T: Sized,
Unwrap the data.
pub fn into_raw_parts(self) -> (T, Span) where
T: Sized,
[src]
T: Sized,
Break the wrapper into the value and its location.
Trait Implementations
impl<T: PartialOrd> PartialOrd<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> RefUnwindSafe for Loc<T> where
T: RefUnwindSafe,
impl<T: ?Sized> UnwindSafe for Loc<T> where
T: UnwindSafe,
impl<T: ?Sized> UnwindSafe for Loc<T> where
T: UnwindSafe,