Skip to main content

SpanBytes

Function SpanBytes 

Source
pub fn SpanBytes(Span: Span, Source: &str) -> Option<(usize, usize)>
Expand description

Extract a byte range from a proc_macro2 Span relative to Source.

Returns None when span information is unavailable (both offsets are 0 for a token that is clearly not at the very start of the file, which indicates that span-locations are not compiled in).