devela::_dep::winnow::stream

Trait Offset

pub trait Offset<Start = Self> {
    // Required method
    fn offset_from(&self, start: &Start) -> usize ;
}
Available on crate feature dep_winnow only.
Expand description

Useful functions to calculate the offset between slices and show a hexdump of a slice

Required Methods§

fn offset_from(&self, start: &Start) -> usize

Offset between the first byte of start and the first byte of selfa

Note: This is an offset, not an index, and may point to the end of input (start.len()) when self is exhausted.

Implementations on Foreign Types§

§

impl Offset for &str

§

fn offset_from(&self, start: &&str) -> usize

§

impl<'a> Offset<<&'a str as Stream>::Checkpoint> for &'a str

§

fn offset_from(&self, other: &<&'a str as Stream>::Checkpoint) -> usize

§

impl<'a, T> Offset<<&'a [T] as Stream>::Checkpoint> for &'a [T]
where T: Clone + Debug,

§

fn offset_from(&self, other: &<&'a [T] as Stream>::Checkpoint) -> usize

§

impl<I> Offset for (I, usize)
where I: Offset,

§

fn offset_from(&self, start: &(I, usize)) -> usize

§

impl<I> Offset<<(I, usize) as Stream>::Checkpoint> for (I, usize)
where I: Stream<Token = u8> + Clone,

§

fn offset_from(&self, other: &<(I, usize) as Stream>::Checkpoint) -> usize

§

impl<T> Offset for &[T]

§

fn offset_from(&self, start: &&[T]) -> usize

Implementors§

§

impl Offset for &BStr

§

impl Offset for &Bytes

§

impl<'a> Offset<<&'a BStr as Stream>::Checkpoint> for &'a BStr

§

impl<'a> Offset<<&'a Bytes as Stream>::Checkpoint> for &'a Bytes

§

impl<I> Offset for LocatingSlice<I>
where I: Stream,

§

impl<I> Offset for Partial<I>
where I: Stream,

§

impl<I> Offset<<LocatingSlice<I> as Stream>::Checkpoint> for LocatingSlice<I>
where I: Stream,

§

impl<I> Offset<<Partial<I> as Stream>::Checkpoint> for Partial<I>
where I: Stream,

§

impl<I, S> Offset for Stateful<I, S>
where I: Stream, S: Clone + Debug,

§

impl<I, S> Offset for Checkpoint<I, S>
where I: Offset,

§

impl<I, S> Offset<<Stateful<I, S> as Stream>::Checkpoint> for Stateful<I, S>
where I: Stream, S: Debug,