pub type MaybeSpanned<'a, T = ()> = LocatedSpan<CodeFragment<'a>, T>;
Expand description
Value with an optional associated code span.
Aliased Type§
pub struct MaybeSpanned<'a, T = ()> {
pub extra: T,
/* private fields */
}
Fields§
§extra: T
Extra information that can be embedded by the user.
Implementations§
Source§impl<'a> MaybeSpanned<'a>
impl<'a> MaybeSpanned<'a>
Source§impl<T> MaybeSpanned<'_, T>
impl<T> MaybeSpanned<'_, T>
Sourcepub fn code_or_location(&self, default_name: &str) -> String
pub fn code_or_location(&self, default_name: &str) -> String
Returns either the original code fragment (if it’s retained), or a string in the form
{default_name} at {line}:{column}
.
Trait Implementations§
Source§impl<'a, T> From<LocatedSpan<&'a str, T>> for MaybeSpanned<'a, T>
impl<'a, T> From<LocatedSpan<&'a str, T>> for MaybeSpanned<'a, T>
Source§impl<T: Clone + 'static> StripCode for MaybeSpanned<'_, T>
impl<T: Clone + 'static> StripCode for MaybeSpanned<'_, T>
Source§type Stripped = LocatedSpan<CodeFragment<'static>, T>
type Stripped = LocatedSpan<CodeFragment<'static>, T>
Resulting type after code stripping.
Source§fn strip_code(self) -> Self::Stripped
fn strip_code(self) -> Self::Stripped
Strips references to code fragments in this type.