Type Alias Spanned

Source
pub type Spanned<'a, T = ()> = LocatedSpan<&'a str, T>;
Expand description

Value with an associated code span.

Aliased Type§

pub struct Spanned<'a, T = ()> {
    pub extra: T,
    /* private fields */
}

Fields§

§extra: T

Extra information that can be embedded by the user.

Implementations§

Source§

impl<'a> Spanned<'a>

Source

pub fn from_str<R>(code: &'a str, range: R) -> Self
where InputSpan<'a>: Slice<R>,

Creates a span from a range in the provided code. This is mostly useful for testing.