Struct jit::Context
[−]
[src]
pub struct Context<T = ()> { // some fields omitted }
Holds all of the functions you have built and compiled. There can be multiple, but normally there is only one.
The type parameter T
represents the type of the tagged data on the
context, which can be indexed to get this data. If you do not want
to tag the context with data, make sure to instantiate it with a
unit (()
) for T
, like so:
use jit::Context; let ctx = Context::<()>::new();
However, if you do want to set tagged data on it, simply put the type
of the data as the T
parameter when you instantiate it, like so:
use jit::Context; let mut ctx = Context::<usize>::new(); ctx[0] = 42; ctx[1] = 21; assert_eq!(ctx[0], 42); assert_eq!(ctx[1], 21);
Methods
impl<T = ()> Context<T>
fn new() -> Context<T>
Create a new JIT Context
fn functions(&self) -> Functions
Iterate through the functions contained inside this context