Struct proc_macro_error::SpanRange [−][src]
Fields
first: Spanlast: SpanImplementations
impl SpanRange[src]
impl SpanRange[src]pub fn single_span(span: Span) -> Self[src]
Create a range with the first and last spans being the same.
pub fn call_site() -> Self[src]
Create a SpanRange resolving at call site.
pub fn from_tokens(ts: &dyn ToTokens) -> Self[src]
Construct span range from a TokenStream. This method always preserves all the
range.
Note
If the stream is empty, the result is SpanRange::call_site(). If the stream
consists of only one TokenTree, the result is SpanRange::single_span(tt.span())
that doesn’t lose anything.
pub fn join_range(self, other: SpanRange) -> Self[src]
Join two span ranges. The resulting range will start at self.first and end at
other.last.
pub fn collapse(self) -> Span[src]
Collapse the range into single span, preserving as much information as possible.