Struct naga::span::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
offset
andlength
are in bytes (UTF-8 code units), instead of UTF-16 code units.line_position
is in bytes (UTF-8 code units), instead of UTF-16 code units.
Fields§
§line_number: u32
1-based line number.
line_position: u32
1-based column in code units (in bytes) of the start of the span.
offset: u32
0-based Offset in code units (in bytes) of the start of the span.
length: u32
Length 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
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.