pub struct Parser {
pub expr_len_limit: usize,
pub expr_depth_limit: usize,
}
Fields§
§expr_len_limit: usize
§expr_depth_limit: usize
Implementations§
Source§impl Parser
impl Parser
pub const fn new() -> Self
Sourcepub fn parse(
&self,
expr_str: &str,
slab: &mut ParseSlab,
) -> Result<ExpressionI, Error>
pub fn parse( &self, expr_str: &str, slab: &mut ParseSlab, ) -> Result<ExpressionI, Error>
Use this function to parse an expression String. The Slab
will be cleared first.
Sourcepub fn parse_noclear(
&self,
expr_str: &str,
slab: &mut ParseSlab,
) -> Result<ExpressionI, Error>
pub fn parse_noclear( &self, expr_str: &str, slab: &mut ParseSlab, ) -> Result<ExpressionI, Error>
This is exactly the same as parse()
but the Slab
will NOT be cleared.
This is useful in performance-critical sections, when you know that you
already have an empty Slab
.
This function cannot return Result<&Expression> because it would prolong the mut ref. / That’s why we return an ExpressionI instead.
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