pub struct Context<O, D>where
O: Operation,{
pub graph: CompilationResult<O>,
pub data: D,
}
Expand description
A compilation context. This stores the current parse graph.
Fields§
§graph: CompilationResult<O>
The parse graph.
data: D
Data given by the consumer.
Implementations§
Source§impl<O, D> Context<O, D>where
O: Operation,
impl<O, D> Context<O, D>where
O: Operation,
Sourcepub fn add_binary_operation(
&mut self,
operation: O,
left: NodeIndex,
right: NodeIndex,
) -> NodeIndex
pub fn add_binary_operation( &mut self, operation: O, left: NodeIndex, right: NodeIndex, ) -> NodeIndex
Add a binary operation node to the parse graph and edges for the left and right operands.
Sourcepub fn add_unary_operation(
&mut self,
operation: O,
parent: NodeIndex,
) -> NodeIndex
pub fn add_unary_operation( &mut self, operation: O, parent: NodeIndex, ) -> NodeIndex
Add a unary operation node to the parse graph and an edge for the unary operand.
Trait Implementations§
Source§impl<'de, O, D> Deserialize<'de> for Context<O, D>
impl<'de, O, D> Deserialize<'de> for Context<O, D>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<O, D> Freeze for Context<O, D>where
D: Freeze,
impl<O, D> RefUnwindSafe for Context<O, D>where
D: RefUnwindSafe,
O: RefUnwindSafe,
impl<O, D> Send for Context<O, D>
impl<O, D> Sync for Context<O, D>
impl<O, D> Unpin for Context<O, D>
impl<O, D> UnwindSafe for Context<O, D>where
D: UnwindSafe,
O: UnwindSafe,
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