Struct naga::SourceLocation
source · pub struct SourceLocation {
pub line_number: u32,
pub line_position: u32,
pub offset: u32,
pub length: u32,
}Expand description
A human-readable representation for a span, tailored for text source.
Roughly corresponds to the positional members of GPUCompilationMessage from
the WebGPU specification, except
offsetandlengthare in bytes (UTF-8 code units), instead of UTF-16 code units.line_positioncounts entire Unicode code points, instead of UTF-16 code units.
Fields§
§line_number: u321-based line number.
line_position: u321-based column of the start of this span, counted in Unicode code points.
offset: u320-based Offset in code units (in bytes) of the start of the span.
length: u32Length in code units (in bytes) of the span.
Trait Implementations§
source§impl Clone for SourceLocation
impl Clone for SourceLocation
source§fn clone(&self) -> SourceLocation
fn clone(&self) -> SourceLocation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for SourceLocation
impl Debug for SourceLocation
source§impl PartialEq for SourceLocation
impl PartialEq for SourceLocation
source§fn eq(&self, other: &SourceLocation) -> bool
fn eq(&self, other: &SourceLocation) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Copy for SourceLocation
impl Eq for SourceLocation
impl StructuralPartialEq for SourceLocation
Auto Trait Implementations§
impl Freeze for SourceLocation
impl RefUnwindSafe for SourceLocation
impl Send for SourceLocation
impl Sync for SourceLocation
impl Unpin for SourceLocation
impl UnwindSafe for SourceLocation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.