[−][src]Struct diffr_lib::Tokenization
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 n
th token.
pub fn nth_span(&self, n: isize) -> HashedSpan
[src]
Get the span correponding to self
's n
th token.
Trait Implementations
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,