pub struct Span { /* private fields */ }
Available on
wgpu_core
or naga
only.Expand description
A source code span, used for error reporting.
Implementations§
source§impl Span
impl Span
pub const UNDEFINED: Span = _
Available on
wgpu_core
only.sourcepub const fn new(start: u32, end: u32) -> Span
Available on wgpu_core
only.
pub const fn new(start: u32, end: u32) -> Span
wgpu_core
only.Creates a new Span
from a range of byte indices
Note: end is exclusive, it doesn’t belong to the Span
sourcepub const fn until(&self, other: &Span) -> Span
Available on wgpu_core
only.
pub const fn until(&self, other: &Span) -> Span
wgpu_core
only.Returns a new Span
starting at self
and ending at other
sourcepub fn subsume(&mut self, other: Span)
Available on wgpu_core
only.
pub fn subsume(&mut self, other: Span)
wgpu_core
only.Modifies self
to contain the smallest Span
possible that
contains both self
and other
sourcepub fn total_span<T>(from: T) -> Span
Available on wgpu_core
only.
pub fn total_span<T>(from: T) -> Span
wgpu_core
only.Returns the smallest Span
possible that contains all the Span
s
defined in the from
iterator
sourcepub fn to_range(self) -> Option<Range<usize>>
Available on wgpu_core
only.
pub fn to_range(self) -> Option<Range<usize>>
wgpu_core
only.Converts self
to a range if the span is not unknown
sourcepub fn is_defined(&self) -> bool
Available on wgpu_core
only.
pub fn is_defined(&self) -> bool
wgpu_core
only.Check whether self
was defined or is a default/unknown span
sourcepub fn location(&self, source: &str) -> SourceLocation
Available on wgpu_core
only.
pub fn location(&self, source: &str) -> SourceLocation
wgpu_core
only.Return a SourceLocation
for this span in the provided source.
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Span
impl<'arbitrary> Arbitrary<'arbitrary> for Span
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Span, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Span, Error>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§impl PartialEq for Span
impl PartialEq for Span
impl Copy for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnwindSafe for Span
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