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
counts entire Unicode code points, 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, counted in Unicode code points.
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.