pub(crate) struct OffsetSpanProvider<'a, T: SpanProvider = SourceSpanProvider<'a>> {
pub(crate) offset: usize,
pub(crate) inner: &'a T,
}Expand description
A SpanProvider which starts at a given offset in the document.
All given offsets are changed by the given amount before computing the
resulting RawUriSpan with the inner SpanProvider.
Fields§
§offset: usizeThe byte offset in the document by which all given offsets are changed before computing the
resulting RawUriSpan with the inner SpanProvider.
inner: &'a TThe inner SpanProvider which will be used to determine the spans.
Trait Implementations§
Source§impl<'a, T: Clone + SpanProvider> Clone for OffsetSpanProvider<'a, T>
impl<'a, T: Clone + SpanProvider> Clone for OffsetSpanProvider<'a, T>
Source§fn clone(&self) -> OffsetSpanProvider<'a, T>
fn clone(&self) -> OffsetSpanProvider<'a, T>
Returns a duplicate 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<'a, T: Debug + SpanProvider> Debug for OffsetSpanProvider<'a, T>
impl<'a, T: Debug + SpanProvider> Debug for OffsetSpanProvider<'a, T>
Source§impl<T: SpanProvider> SpanProvider for OffsetSpanProvider<'_, T>
impl<T: SpanProvider> SpanProvider for OffsetSpanProvider<'_, T>
Source§fn span(&self, offset: usize) -> RawUriSpan
fn span(&self, offset: usize) -> RawUriSpan
Compute the
RawUriSpan at a given byte offset in the document.Auto Trait Implementations§
impl<'a, T> Freeze for OffsetSpanProvider<'a, T>
impl<'a, T> RefUnwindSafe for OffsetSpanProvider<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for OffsetSpanProvider<'a, T>where
T: Sync,
impl<'a, T> Sync for OffsetSpanProvider<'a, T>where
T: Sync,
impl<'a, T> Unpin for OffsetSpanProvider<'a, T>
impl<'a, T> UnsafeUnpin for OffsetSpanProvider<'a, T>
impl<'a, T> UnwindSafe for OffsetSpanProvider<'a, T>where
T: RefUnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more