Skip to main content

BytePos

Type Alias BytePos 

Source
pub type BytePos = u32;
Expand description

A byte offset into the concatenated source map.

One flat coordinate space across every file in the translation unit, so a span is eight bytes and comparing two spans does not need to know which file they came from. The map from offset to file, line and column is built once and queried only when a diagnostic is actually rendered, which keeps the cost off the hot path.