Struct naga::Span

source ·
pub struct Span { /* private fields */ }
Expand description

A source code span, used for error reporting.

Implementations§

Creates a new Span from a range of byte indices

Note: end is exclusive, it doesn’t belong to the Span

Returns a new Span starting at self and ending at other

Modifies self to contain the smallest Span possible that contains both self and other

Returns the smallest Span possible that contains all the Spans defined in the from iterator

Converts self to a range if the span is not unknown

Check whether self was defined or is a default/unknown span

Return a SourceLocation for this span in the provided source.

Trait Implementations§

Generate an arbitrary value of Self from the given unstructured data. Read more
Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.