pub struct CompilationContext<'a> {
pub index: Cell<usize>,
pub inserted_value_index: Cell<usize>,
pub buffer: RefCell<Vec<u8>>,
pub inserted_values: RefCell<&'a [&'a ValueContainer]>,
pub has_non_static_value: RefCell<bool>,
pub is_end_of_source_text: bool,
/* private fields */
}Expand description
compilation context, created for each compiler call, even if compiling a script for the same scope
Fields§
§index: Cell<usize>§inserted_value_index: Cell<usize>§buffer: RefCell<Vec<u8>>§inserted_values: RefCell<&'a [&'a ValueContainer]>§has_non_static_value: RefCell<bool>this flag is set to true if any non-static value is encountered
is_end_of_source_text: boolSet to true if no further source text is expected to be compiled. Example: for a REPL, this is set to false
Implementations§
Source§impl<'a> CompilationContext<'a>
impl<'a> CompilationContext<'a>
pub fn new( buffer: RefCell<Vec<u8>>, inserted_values: &'a [&'a ValueContainer], is_end_of_source_text: bool, ) -> Self
pub fn external_slots(&self) -> Vec<VirtualSlot>
Sourcepub fn get_slot_byte_indices(&self, match_externals: bool) -> Vec<Vec<u32>>
pub fn get_slot_byte_indices(&self, match_externals: bool) -> Vec<Vec<u32>>
Gets all slots for either local or external slots depending on the value of external
pub fn remap_virtual_slots(&self)
pub fn insert_virtual_slot_address(&self, virtual_slot: VirtualSlot)
pub fn insert_value_container(&self, value_container: &ValueContainer)
pub fn insert_value(&self, value: &Value)
pub fn insert_boolean(&self, boolean: bool)
pub fn insert_text(&self, string: &str)
pub fn insert_key_value_pair( &self, key: &ValueContainer, value: &ValueContainer, )
pub fn insert_key_string(&self, key_string: &str)
pub fn insert_typed_decimal(&self, decimal: &TypedDecimal)
pub fn insert_float32(&self, float32: f32)
pub fn insert_float64(&self, float64: f64)
pub fn insert_endpoint(&self, endpoint: &Endpoint)
pub fn insert_decimal(&self, decimal: &Decimal)
pub fn insert_float_as_i16(&self, int: i16)
pub fn insert_float_as_i32(&self, int: i32)
pub fn insert_int(&self, int: i64)
pub fn insert_i8(&self, int8: i8)
pub fn insert_i16(&self, int16: i16)
pub fn insert_i32(&self, int32: i32)
pub fn insert_i64(&self, int64: i64)
pub fn insert_i128(&self, int128: i128)
pub fn insert_u8(&self, uint8: u8)
pub fn insert_u16(&self, uint16: u16)
pub fn insert_u32(&self, uint32: u32)
pub fn insert_u64(&self, uint64: u64)
pub fn insert_u128(&self, uint128: u128)
pub fn append_u8(&self, u8: u8)
pub fn append_u32(&self, u32: u32)
pub fn set_u32_at_index(&self, u32: u32, index: usize)
pub fn append_i8(&self, i8: i8)
pub fn append_i16(&self, i16: i16)
pub fn append_i32(&self, i32: i32)
pub fn append_i64(&self, i64: i64)
pub fn append_i128(&self, i128: i128)
pub fn append_u128(&self, u128: u128)
pub fn append_f32(&self, f32: f32)
pub fn append_f64(&self, f64: f64)
pub fn append_string_utf8(&self, string: &str)
pub fn append_buffer(&self, buffer: &[u8])
pub fn mark_has_non_static_value(&self)
pub fn append_binary_code(&self, binary_code: InstructionCode)
Auto Trait Implementations§
impl<'a> !Freeze for CompilationContext<'a>
impl<'a> !RefUnwindSafe for CompilationContext<'a>
impl<'a> !Send for CompilationContext<'a>
impl<'a> !Sync for CompilationContext<'a>
impl<'a> Unpin for CompilationContext<'a>
impl<'a> !UnwindSafe for CompilationContext<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more