Struct source_span::Loc [−][src]
pub struct Loc<T: ?Sized> { /* fields omitted */ }
Expand description
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]
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 inner_into<U>(self) -> Loc<U> where
T: Into<U>,
[src]
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]
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]
pub fn into_inner(self) -> T where
T: Sized,
[src]Unwrap the data.
Trait Implementations
impl<T: Ord> Ord for Loc<T>
[src]
impl<T: Ord> Ord for Loc<T>
[src]impl<T: PartialOrd> PartialOrd<Loc<T>> for Loc<T>
[src]
impl<T: PartialOrd> PartialOrd<Loc<T>> for Loc<T>
[src]fn partial_cmp(&self, other: &Loc<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Loc<T>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T: Eq> Eq for Loc<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Loc<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized> Send for Loc<T> where
T: Send,
T: Send,
impl<T: ?Sized> Sync for Loc<T> where
T: Sync,
T: Sync,
impl<T: ?Sized> Unpin for Loc<T> where
T: Unpin,
T: Unpin,
impl<T: ?Sized> UnwindSafe for Loc<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more