[][src]Struct diffr_lib::Tokenization

pub struct Tokenization<'a> { /* fields omitted */ }

A tokenized slice of bytes.

Methods

impl<'a> Tokenization<'a>[src]

pub fn new(data: &'a [u8], tokens: &'a [HashedSpan]) -> Self[src]

pub fn data(&self) -> &'a [u8][src]

pub fn split_at(&self, lo: isize, hi: isize) -> (Self, Self)[src]

Split self in two tokenizations:

  • the first one from the start to lo;
  • the second one from hi to the end.

pub fn nb_tokens(&self) -> usize[src]

Get self's number of tokens.

pub fn nth_token(&self, n: isize) -> HashedSlice[src]

Get self's nth token.

pub fn nth_span(&self, n: isize) -> HashedSpan[src]

Get the span correponding to self's nth token.

Trait Implementations

impl<'a> Debug for Tokenization<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for Tokenization<'a>

impl<'a> Sync for Tokenization<'a>

impl<'a> Send for Tokenization<'a>

impl<'a> UnwindSafe for Tokenization<'a>

impl<'a> RefUnwindSafe for Tokenization<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]