[−][src]Struct interact::Token
Represents a single meaningful substring part in an Interact string expression.
Fields
kind: TokenKindToken kind
text: Cow<'a, str>Token text
space_diff: usizeAmount of whitespace from the previous token
Methods
impl<'a> Token<'a>[src]
pub fn new_owned(s: String) -> Self[src]
pub fn new_borrowed(kind: TokenKind, s: &'static str) -> Self[src]
pub fn clone_owned(&self) -> Token<'static>[src]
pub fn similar(&self, token: &Token) -> bool[src]
Returns whether two tokens are idential with whitespace removed.
pub fn is_prefix_of(&self, token: &Token) -> bool[src]
Returns whether one token is a prefix or another.
pub fn space_suffix(&self) -> usize[src]
Return the amount of space following the text of the token.
Trait Implementations
impl<'a> PartialEq<Token<'a>> for Token<'a>[src]
impl<'a> Clone for Token<'a>[src]
fn clone(&self) -> Token<'a>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<'a> Eq for Token<'a>[src]
impl<'a> Debug for Token<'a>[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,