[][src]Struct pretok::Pretoken

pub struct Pretoken<'a> {
    pub s: &'a str,
    pub line: usize,
    pub offset: usize,
}

A pretoken object contains a slice of the Pretokenizer input string with lifetime a.

Fields

s: &'a str

The UTF-8 string slice.

line: usize

Number > 0 of the last line in this pretoken.

offset: usize

The byte offset of the first character in the pretoken.

Implementations

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

pub fn new(
    start: StrCursor<'a>,
    end: StrCursor<'a>,
    line: usize,
    offset: usize
) -> Pretoken<'a>
[src]

The string for this pretoken is the slice between the specified cursors.

  • start: The starting code point (inclusive).
  • end: The end code point (exclusive).
  • offset: The byte offset of start from the front of the string used to initialize the Pretokenizer.

Trait Implementations

impl<'a> Clone for Pretoken<'a>[src]

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

impl<'a> PartialEq<Pretoken<'a>> for Pretoken<'a>[src]

impl<'a> StructuralPartialEq for Pretoken<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Pretoken<'a>

impl<'a> Send for Pretoken<'a>

impl<'a> Sync for Pretoken<'a>

impl<'a> Unpin for Pretoken<'a>

impl<'a> UnwindSafe for Pretoken<'a>

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.