[][src]Struct autumn::Meta

pub struct Meta<T, I> { /* fields omitted */ }

Structure to tag an object with a positional information

This can be used to associate any value with a particular Location or Span within a source text.

Methods

impl<T, I> Meta<T, I>[src]

pub fn inner(self) -> T[src]

Unwrap the meta and return only the inner value

pub fn inner_ref(&self) -> &T[src]

Get a reference to the inner value

pub fn inner_mut(&mut self) -> &mut T[src]

Get a reference to the inner value

pub fn split(self) -> (T, I)[src]

Split a meta into a separate value and location

pub fn map<A>(self, map: impl FnMut(T) -> A) -> Meta<A, I>[src]

Map the value within the meta

impl<T, I: Clone> Meta<T, I>[src]

pub fn as_ref(&self) -> Meta<&T, I>[src]

Create a new meta referencing the original value

pub fn as_mut(&mut self) -> Meta<&mut T, I>[src]

Create a new meta mutably referencing the original value

impl<T> Meta<T, Location>[src]

pub fn span(self) -> Meta<T, Span>[src]

Turn a meta referring to a single Location to an empty Span starting at the same location.

Trait Implementations

impl<T: Clone, I: Clone> Clone for Meta<T, I>[src]

impl<T: Copy, I: Copy> Copy for Meta<T, I>[src]

impl<T: Debug, I: Debug> Debug for Meta<T, I>[src]

impl<T, I> Deref for Meta<T, I>[src]

type Target = T

The resulting type after dereferencing.

impl<T, I> DerefMut for Meta<T, I>[src]

impl<T: Display, I: Display> Display for Meta<T, I>[src]

impl<T: Eq, I: Eq> Eq for Meta<T, I>[src]

impl<T, I> Error for Meta<T, I> where
    T: Error,
    I: Display + Debug
[src]

impl<T: Ord, I: Ord> Ord for Meta<T, I>[src]

impl<T, E, P: Parser<T, E>> Parser<Meta<T, Span>, E> for MetaMap<P, E>[src]

impl<T: PartialEq, I: PartialEq> PartialEq<Meta<T, I>> for Meta<T, I>[src]

impl<T: PartialOrd, I: PartialOrd> PartialOrd<Meta<T, I>> for Meta<T, I>[src]

impl<T, I> StructuralEq for Meta<T, I>[src]

impl<T, I> StructuralPartialEq for Meta<T, I>[src]

Auto Trait Implementations

impl<T, I> RefUnwindSafe for Meta<T, I> where
    I: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, I> Send for Meta<T, I> where
    I: Send,
    T: Send

impl<T, I> Sync for Meta<T, I> where
    I: Sync,
    T: Sync

impl<T, I> Unpin for Meta<T, I> where
    I: Unpin,
    T: Unpin

impl<T, I> UnwindSafe for Meta<T, I> where
    I: UnwindSafe,
    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.