pub struct Operator<O> {
pub op: O,
pub associativity: Associativity,
pub size: OperatorSize,
pub precedence: usize,
pub parser: Box<dyn Fn(&[u8]) -> IResult<&[u8], &[u8]>>,
}
Expand description
An Operator wrapper with extra info for parsing
Fields§
§op: O
The underlying operator enum
associativity: Associativity
The associativity of the operator
size: OperatorSize
Size of the operator, Unary, Binary, etc…
precedence: usize
The precedence of the operator If * has precedence 10 and - has precedence 9 the following expression 1 * 2 - 3 would parse as (1 * 2) - 3
parser: Box<dyn Fn(&[u8]) -> IResult<&[u8], &[u8]>>
The nom parser function
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<O> Freeze for Operator<O>where
O: Freeze,
impl<O> !RefUnwindSafe for Operator<O>
impl<O> !Send for Operator<O>
impl<O> !Sync for Operator<O>
impl<O> Unpin for Operator<O>where
O: Unpin,
impl<O> !UnwindSafe for Operator<O>
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