Struct CompilationContext

Source
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: bool

Set 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>

Source

pub fn new( buffer: RefCell<Vec<u8>>, inserted_values: &'a [&'a ValueContainer], is_end_of_source_text: bool, ) -> Self

Source

pub fn external_slots(&self) -> Vec<VirtualSlot>

Source

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

Source

pub fn remap_virtual_slots(&self)

Source

pub fn insert_virtual_slot_address(&self, virtual_slot: VirtualSlot)

Source

pub fn insert_value_container(&self, value_container: &ValueContainer)

Source

pub fn insert_value(&self, value: &Value)

Source

pub fn insert_boolean(&self, boolean: bool)

Source

pub fn insert_text(&self, string: &str)

Source

pub fn insert_key_value_pair( &self, key: &ValueContainer, value: &ValueContainer, )

Source

pub fn insert_key_string(&self, key_string: &str)

Source

pub fn insert_typed_decimal(&self, decimal: &TypedDecimal)

Source

pub fn insert_float32(&self, float32: f32)

Source

pub fn insert_float64(&self, float64: f64)

Source

pub fn insert_endpoint(&self, endpoint: &Endpoint)

Source

pub fn insert_decimal(&self, decimal: &Decimal)

Source

pub fn insert_float_as_i16(&self, int: i16)

Source

pub fn insert_float_as_i32(&self, int: i32)

Source

pub fn insert_int(&self, int: i64)

Source

pub fn insert_i8(&self, int8: i8)

Source

pub fn insert_i16(&self, int16: i16)

Source

pub fn insert_i32(&self, int32: i32)

Source

pub fn insert_i64(&self, int64: i64)

Source

pub fn insert_i128(&self, int128: i128)

Source

pub fn insert_u8(&self, uint8: u8)

Source

pub fn insert_u16(&self, uint16: u16)

Source

pub fn insert_u32(&self, uint32: u32)

Source

pub fn insert_u64(&self, uint64: u64)

Source

pub fn insert_u128(&self, uint128: u128)

Source

pub fn append_u8(&self, u8: u8)

Source

pub fn append_u32(&self, u32: u32)

Source

pub fn set_u32_at_index(&self, u32: u32, index: usize)

Source

pub fn append_i8(&self, i8: i8)

Source

pub fn append_i16(&self, i16: i16)

Source

pub fn append_i32(&self, i32: i32)

Source

pub fn append_i64(&self, i64: i64)

Source

pub fn append_i128(&self, i128: i128)

Source

pub fn append_u128(&self, u128: u128)

Source

pub fn append_f32(&self, f32: f32)

Source

pub fn append_f64(&self, f64: f64)

Source

pub fn append_string_utf8(&self, string: &str)

Source

pub fn append_buffer(&self, buffer: &[u8])

Source

pub fn mark_has_non_static_value(&self)

Source

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<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,