Struct proc_macro_error::SpanRange [−][src]
Fields
first: Span
last: Span
Implementations
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SpanRange
impl !Send for SpanRange
impl !Sync for SpanRange
impl Unpin for SpanRange
impl UnwindSafe for SpanRange
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,