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.
Corresponds to the positional members of GPUCompilationMessage
from
the WebGPU specification, except that offset
and length
are 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 of the start of this 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
sourceimpl Clone for SourceLocation
impl Clone for SourceLocation
sourcefn clone(&self) -> SourceLocation
fn clone(&self) -> SourceLocation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SourceLocation
impl Debug for SourceLocation
sourceimpl PartialEq<SourceLocation> for SourceLocation
impl PartialEq<SourceLocation> for SourceLocation
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &SourceLocation) -> bool
fn ne(&self, other: &SourceLocation) -> bool
This method tests for !=
.
impl Copy for SourceLocation
impl Eq for SourceLocation
impl StructuralEq for SourceLocation
impl StructuralPartialEq for SourceLocation
Auto Trait Implementations
impl RefUnwindSafe for SourceLocation
impl Send for SourceLocation
impl Sync for SourceLocation
impl Unpin for SourceLocation
impl UnwindSafe for SourceLocation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.