pub struct Span {
pub start: usize,
pub end: usize,
}Expand description
Locate a byte range in the d2 source, convertible to both a model span and a miette span.
Fields§
§start: usize§end: usizeImplementations§
Trait Implementations§
impl Copy for Span
impl Eq for Span
Source§impl From<Span> for SourceSpan
impl From<Span> for SourceSpan
Source§impl Span for Span
impl Span for Span
Source§type Offset = usize
type Offset = usize
A type representing a span’s start or end offset from the start of the input. Read more
Source§fn new(_context: (), range: Range<usize>) -> Self
fn new(_context: (), range: Range<usize>) -> Self
Create a new span given a context and an offset range.
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Forget for Span
impl Freeze for Span
impl Move for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin 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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.