Enum asn1rs_model::parser::Token
source · pub enum Token {
Text(Location, String),
Separator(Location, char),
}
Variants§
Implementations§
source§impl Token
impl Token
pub fn location(&self) -> Location
pub fn eq_text(&self, text: &str) -> bool
pub fn eq_text_ignore_ascii_case(&self, text: &str) -> bool
pub fn eq_separator(&self, separator: char) -> bool
pub fn text(&self) -> Option<&str>
pub fn separator(&self) -> Option<char>
pub fn is_text(&self) -> bool
pub fn is_separator(&self) -> bool
pub fn into_text(self) -> Option<String>
pub fn into_text_or_else<E, F: FnOnce(Token) -> E>( self, f: F ) -> Result<String, E>
pub fn into_separator_or_else<E, F: FnOnce(Token) -> E>( self, f: F ) -> Result<char, E>
Trait Implementations§
source§impl PartialEq<Token> for Token
impl PartialEq<Token> for Token
source§impl PartialOrd<Token> for Token
impl PartialOrd<Token> for Token
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Token
impl StructuralEq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.