pub enum PrattParserRule {
Prefix {
operator: Arc<dyn Fn(&ParserOutput) -> bool + Send + Sync>,
transformer: Arc<dyn Fn(ParserOutput) -> ParserOutput + Send + Sync>,
},
Postfix {
operator: Arc<dyn Fn(&ParserOutput) -> bool + Send + Sync>,
transformer: Arc<dyn Fn(ParserOutput) -> ParserOutput + Send + Sync>,
},
Infix {
operator: Arc<dyn Fn(&ParserOutput) -> bool + Send + Sync>,
transformer: Arc<dyn Fn(ParserOutput, ParserOutput) -> ParserOutput + Send + Sync>,
associativity: PrattParserAssociativity,
},
}
Variants§
Prefix
Fields
§
transformer: Arc<dyn Fn(ParserOutput) -> ParserOutput + Send + Sync>
Postfix
Fields
§
transformer: Arc<dyn Fn(ParserOutput) -> ParserOutput + Send + Sync>
Infix
Fields
§
transformer: Arc<dyn Fn(ParserOutput, ParserOutput) -> ParserOutput + Send + Sync>
§
associativity: PrattParserAssociativity
Implementations§
Source§impl PrattParserRule
impl PrattParserRule
pub fn prefx_raw( operator: impl Fn(&ParserOutput) -> bool + Send + Sync + 'static, transformer: impl Fn(ParserOutput) -> ParserOutput + Send + Sync + 'static, ) -> Self
pub fn prefix<O: PartialEq + Send + Sync + 'static, V: Send + Sync + 'static>( operator: O, transformer: impl Fn(V) -> V + Send + Sync + 'static, ) -> Self
pub fn postfix_raw( operator: impl Fn(&ParserOutput) -> bool + Send + Sync + 'static, transformer: impl Fn(ParserOutput) -> ParserOutput + Send + Sync + 'static, ) -> Self
pub fn postfix<O: PartialEq + Send + Sync + 'static, V: Send + Sync + 'static>( operator: O, transformer: impl Fn(V) -> V + Send + Sync + 'static, ) -> Self
pub fn infix_raw( operator: impl Fn(&ParserOutput) -> bool + Send + Sync + 'static, transformer: impl Fn(ParserOutput, ParserOutput) -> ParserOutput + Send + Sync + 'static, associativity: PrattParserAssociativity, ) -> Self
pub fn infix<O: PartialEq + Send + Sync + 'static, V: Send + Sync + 'static>( operator: O, transformer: impl Fn(V, V) -> V + Send + Sync + 'static, associativity: PrattParserAssociativity, ) -> Self
Trait Implementations§
Source§impl Clone for PrattParserRule
impl Clone for PrattParserRule
Source§fn clone(&self) -> PrattParserRule
fn clone(&self) -> PrattParserRule
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PrattParserRule
impl !RefUnwindSafe for PrattParserRule
impl Send for PrattParserRule
impl Sync for PrattParserRule
impl Unpin for PrattParserRule
impl !UnwindSafe for PrattParserRule
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