Crate spanner

Source
Expand description

§spanner

easy and powerful source spans, including checks for overrunning a buffer

§sizes

supports up to

  • 65535 buffers
  • 4GiB total

Structs§

Buffer
a buffer containing some source code
LineCol
a zero-indexed line and column
Loc
a location in a Buffer
Locd
a value annotated with a Location
Span
a span of start and end Locations in a Buffer
Spanned
a value annotated with a Span
Spanner
handles handing out Spans that point into Buffers
SrcSpan
a span of start and end Locations in a Buffer, including a reference to the Buffer itself
SrcSpanned
a value annotated with a SrcSpan

Traits§

BufferSource
source code for a buffer
SpannerExt
helper extension trait to quickly wrap values

Functions§

calc_line_beginnings
calculate byte offsets for the start of each line
find_line
find the line number for a given offset, passing the line beginnings and byte offset
find_line_col
find the line and column for a given offset, passing the line beginnings and byte offset