Type Definition arithmetic_parser::MaybeSpanned[][src]

type MaybeSpanned<'a, T = ()> = LocatedSpan<CodeFragment<'a>, T>;
Expand description

Value with an optional associated code span.

Implementations

impl<'a> MaybeSpanned<'a>[src]

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

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

impl<T> MaybeSpanned<'_, T>[src]

pub fn code_or_location(&self, default_name: &str) -> String[src]

Returns either the original code fragment (if it’s retained), or a string in the form {default_name} at {line}:{column}.

Trait Implementations

impl<'a, T> From<LocatedSpan<&'a str, T>> for MaybeSpanned<'a, T>[src]

fn from(value: Spanned<'a, T>) -> Self[src]

Performs the conversion.

impl<T: Clone + 'static> StripCode for MaybeSpanned<'_, T>[src]

type Stripped = MaybeSpanned<'static, T>

Resulting type after code stripping.

fn strip_code(self) -> Self::Stripped[src]

Strips references to code fragments in this type.