sl_compiler::compile::destructure

Struct DestructState

Source
pub struct DestructState {
    all_optionals: Vec<Vec<(usize, Value)>>,
    destructures: Vec<Destructure>,
}

Fields§

§all_optionals: Vec<Vec<(usize, Value)>>§destructures: Vec<Destructure>

Implementations§

Source§

impl DestructState

Source

pub fn new() -> Self

Source

fn setup_destructures( &self, env: &mut SloshVm, state: &mut CompileState, free_reg: &mut usize, ) -> VMResult<()>

Source

fn setup_optionals( &self, env: &mut SloshVm, state: &mut CompileState, free_reg: usize, ) -> VMResult<()>

Source

fn do_vector_destructure( &mut self, env: &mut SloshVm, vector_handle: Handle, reg: usize, stack: &mut Vec<DestructType>, next_reg: &mut usize, ) -> VMResult<()>

Source

fn do_map_destructure( &mut self, env: &mut SloshVm, map_handle: Handle, current_reg: usize, stack: &mut Vec<DestructType>, next_reg: &mut usize, ) -> VMResult<()>

Source

pub fn do_destructure( &mut self, env: &mut SloshVm, state: &mut CompileState, destruct_type: DestructType, ) -> VMResult<()>

Source

pub fn compile( &mut self, env: &mut SloshVm, state: &mut CompileState, free_reg: &mut usize, ) -> VMResult<()>

Auto Trait Implementations§

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> 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, 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, 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.