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), and is usually not directly intended for humans.
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. Remember to convert accordingly when displaying to the user.
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 From<SourceLocation> for SourceLocation
Available on wgpu_core
or naga
only.
impl From<SourceLocation> for SourceLocation
Available on
wgpu_core
or naga
only.Source§fn from(value: SourceLocation) -> Self
fn from(value: SourceLocation) -> Self
Converts to this type from the input type.
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§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.