pub struct Tokenizer { /* private fields */ }Implementations§
Source§impl Tokenizer
impl Tokenizer
pub fn new() -> Self
pub fn register_token<C: 'static + Fn(&str) -> Atom>( &mut self, regex: Regex, constr: C, )
pub fn register_fallible_token<C: 'static + Fn(&str) -> Result<Atom, String>>( &mut self, regex: Regex, constr: C, )
pub fn register_token_with_regex_str<C: 'static + Fn(&str) -> Atom>( &mut self, regex: &str, constr: C, )
pub fn register_function<T: 'static + GroundedFunction>( &mut self, func: GroundedFunctionAtom<T>, )
Sourcepub fn move_front(&mut self, from: &mut Tokenizer)
pub fn move_front(&mut self, from: &mut Tokenizer)
Moves all tokenizer entries from from into self, leaving from empty
NOTE: Tokens are tried in reverse order, so move_front actually adds entries that will be tried
last in the priority order
Sourcepub fn move_back(&mut self, from: &mut Tokenizer)
pub fn move_back(&mut self, from: &mut Tokenizer)
Moves all tokenizer entries from from into self, leaving from empty
NOTE: Tokens are tried in reverse order, so move_back actually adds entries that will be tried
first in the priority order
pub fn find_token( &self, token: &str, ) -> Option<&dyn Fn(&str) -> Result<Atom, String>>
pub fn remove_token(&mut self, regex_str: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tokenizer
impl !RefUnwindSafe for Tokenizer
impl !Send for Tokenizer
impl !Sync for Tokenizer
impl Unpin for Tokenizer
impl !UnwindSafe for Tokenizer
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request