Skip to main content

SpanTable

Enum SpanTable 

Source
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

Source

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.

Trait Implementations§

Source§

impl Clone for SpanTable

Source§

fn clone(&self) -> SpanTable

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpanTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SpanTable

Source§

impl Hash for SpanTable

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SpanTable

Source§

fn eq(&self, other: &SpanTable) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SpanTable

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.