Struct Parser
pub struct Parser { /* private fields */ }
Implementations§
§impl Parser
impl Parser
pub fn new( grammar: Arc<CGrammar>, limits: ParserLimits, ) -> Result<Parser, Error>
pub fn compute_bias(
&mut self,
computer: &dyn BiasComputer,
start: &[u8],
) -> SimpleVob
pub fn compute_bias( &mut self, computer: &dyn BiasComputer, start: &[u8], ) -> SimpleVob
This is a top-level method in this file. It is called by compute_mask_inner() in TokenParser in tokenparser.rs. It is used by the compute_mask() method of the LLInterpreter interface.
pub fn captures(&self) -> &[(String, Vec<u8>)]
pub fn stats(&self) -> &ParserStats
pub fn lexer_stats(&self) -> String
pub fn get_error(&self) -> Option<ParserError>
pub fn with_recognizer<T>( &mut self, f: impl FnOnce(&mut ParserRecognizer<'_>) -> T, ) -> T
pub fn get_bytes(&self) -> &[u8] ⓘ
pub fn force_bytes(&mut self) -> &[u8] ⓘ
pub fn scan_eos(&mut self) -> bool
pub fn apply_token(&mut self, tok_bytes: &[u8]) -> Result<usize, Error>
pub fn validate_bytes(&mut self, tok_bytes: &[u8], check_eos: bool) -> usize
pub fn validate_bytes(&mut self, tok_bytes: &[u8], check_eos: bool) -> usize
Returns how many bytes can be applied.
pub fn filter_max_tokens(&mut self)
pub fn log_row_infos(&self, label: &str)
pub fn is_accepting(&mut self) -> bool
pub fn currently_forced_bytes(&self) -> &[u8] ⓘ
pub fn has_pending_lexeme_bytes(&self) -> bool
pub fn grammar(&self) -> &CGrammar
pub fn can_advance(&self) -> bool
pub fn temperature(&self) -> Option<f32>
pub fn deep_clone(&self) -> Parser
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.§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 more