pub enum SpanTable {
ByteOffsets(Bounded<u64, CAPTURED_TREE_TOKEN_LIMIT>),
ProducerHeld,
}Expand description
How a producer answers “where is the token this handle names?”.
Not an option and not a default: nothing here invents a position for a handle it cannot resolve, and a diagnostic coordinate reading byte 0 under a producer-held table would be a fiction.
Variants§
ByteOffsets(Bounded<u64, CAPTURED_TREE_TOKEN_LIMIT>)
Byte offsets into the declared input, one per issued handle.
ProducerHeld
The producer holds the compiler’s spans and resolves handles itself.
Implementations§
Source§impl SpanTable
impl SpanTable
Sourcepub fn coordinate_of(
&self,
span: SpanHandle,
) -> Result<SourceCoordinate, SpanResolutionRefusal>
pub fn coordinate_of( &self, span: SpanHandle, ) -> Result<SourceCoordinate, SpanResolutionRefusal>
Where the token one handle names sits, in whatever coordinate role this producer speaks.
SpanTable::ProducerHeld always answers, and answering is not inventing: the coordinate is in the semantic-origin role and its position is the handle’s own ordinal in reading order, which is the fact the handle already carries.
It states no byte, no line, and no file, because this table holds none.
§Errors
Returns SpanResolutionRefusal where a byte-offset table does not reach the handle.
That table’s whole content is one byte position per handle it issued, so answering with a semantic-origin coordinate at the handle’s index would be a value indistinguishable from an honest answer under the other posture.