rune::core::env::stack

Struct CallFrame

Source
pub(crate) struct CallFrame<'brw, 'rt> {
    env: &'brw mut Rt<Env<'rt>>,
}
Expand description

A function call Frame.

This is a guard type that will pop the frame when it goes out of scope.

Fields§

§env: &'brw mut Rt<Env<'rt>>

Implementations§

Source§

impl<'brw, 'rt> CallFrame<'brw, 'rt>

Source

pub(crate) fn new(env: &'brw mut Rt<Env<'rt>>) -> Self

Create a new function call frame with a drop guard to be removed when this goes out of scope.

Source

pub(crate) fn new_with_args(env: &'brw mut Rt<Env<'rt>>, args: usize) -> Self

Create a new function call frame with the top args on the stack. This frame will be removed when the CallFrame goes out of scope.

Source

pub(crate) fn push_arg(&mut self, arg: impl IntoRoot<Slot<Gc<ObjectType<'rt>>>>)

Push an argument onto the stack as part of this call frame

Source

pub(crate) fn finalize_arguments(&mut self)

Set the total argument count before a function call

Source

pub(crate) fn arg_count(&self) -> usize

Source

pub(crate) fn arg_slice(&self) -> &[Rt<Slot<Gc<ObjectType<'rt>>>>]

Source

pub(crate) fn push_arg_slice(&mut self, src: &[Gc<ObjectType<'_>>])

Push a slice of arguments onto the stack as part of this call frame.

Methods from Deref<Target = Rt<Env<'rt>>>§

Source

fn inner(&self) -> &T

Source

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

Source

fn inner_ptr(&self) -> *const T

Source

fn inner_mut_ptr(&mut self) -> *mut T

Source

pub(crate) fn bind_ref<'a, 'ob>( &'a self, _: &'ob Context<'_>, ) -> &'a <T as WithLifetime<'ob>>::Out
where T: WithLifetime<'ob>,

Source

pub(crate) fn bind_mut<'a, 'ob>( &'a mut self, _: &'ob Context<'_>, ) -> &'a mut <T as WithLifetime<'ob>>::Out
where T: WithLifetime<'ob>,

Source

pub(crate) fn set<U: IntoRoot<T>>(&mut self, item: U)

Source

pub(crate) fn bind<'ob>( &self, _: &'ob Context<'_>, ) -> <T as WithLifetime<'ob>>::Out
where T: WithLifetime<'ob> + Copy,

Source

pub(crate) unsafe fn bind_unchecked<'ob>( &'ob self, ) -> <T as WithLifetime<'ob>>::Out
where T: WithLifetime<'ob> + Copy,

Source

pub(crate) fn untag<'ob, U>(&self, cx: &'ob Context<'_>) -> U
where Gc<T>: WithLifetime<'ob, Out = Gc<U>> + Copy, Gc<U>: Untag<U>,

Calls untag on the tagged Gc pointer

Source

pub(crate) fn try_as<U, E>(&self) -> Result<&Rt<Slot<Gc<U>>>, E>
where Gc<T>: TryInto<Gc<U>, Error = E> + Copy,

Like try_into, but needed to due no specialization

Source

pub(crate) fn bind_as<'ob, U, E>(&self, _cx: &'ob Context<'_>) -> Result<U, E>
where Gc<T>: WithLifetime<'ob> + Copy, <Gc<T> as WithLifetime<'ob>>::Out: TryInto<U, Error = E> + Copy,

Like try_into().bind(cx), but needed to due no specialization

Source

pub(crate) fn cast<U>(&self) -> &Rt<Slot<Gc<U>>>
where Gc<T>: Into<Gc<U>> + Copy,

Like Into, but needed to due no specialization

Source

pub(crate) fn as_cons(&self) -> &Rt<Slot<Gc<&Cons>>>

Source

pub(crate) fn try_as_option<T, E>(&self) -> Result<Option<&Rt<Slot<Gc<T>>>>, E>
where Gc<ObjectType<'a>>: TryInto<Gc<T>, Error = E>,

Source

pub(crate) fn car<'ob>(&self, cx: &'ob Context<'_>) -> Gc<ObjectType<'ob>>

Source

pub(crate) fn cdr<'ob>(&self, cx: &'ob Context<'_>) -> Gc<ObjectType<'ob>>

Source

fn as_mut_ref(&mut self) -> &mut Vec<Rt<T>>

Source

pub(crate) fn push<U: IntoRoot<T>>(&mut self, item: U)

Source

pub(crate) fn truncate(&mut self, len: usize)

Source

pub(crate) fn pop(&mut self)

Source

pub(crate) fn swap_remove(&mut self, index: usize)

Source

pub(crate) fn reserve(&mut self, additional: usize)

Source

pub(crate) fn capacity(&self) -> usize

Source

pub(crate) fn extend_from_slice<U: IntoRoot<T> + Copy>(&mut self, src: &[U])

Source

pub(crate) fn extend_from_within(&mut self, src: impl RangeBounds<usize>)

Source

fn as_ref(&self) -> &IndexMap<K, V>

Source

fn as_mut(&mut self) -> &mut IndexMap<K, V>

Source

pub(crate) fn insert<Kx: IntoRoot<K>, Vx: IntoRoot<V>>(&mut self, k: Kx, v: Vx)

Source

pub(crate) fn get<Q: IntoRoot<K>>(&self, k: Q) -> Option<&Rt<V>>

Source

pub(crate) fn get_mut<Q: IntoRoot<K>>(&mut self, k: Q) -> Option<&mut Rt<V>>

Source

pub(crate) fn remove<Q: IntoRoot<K>>(&mut self, k: Q)

Source

pub(crate) fn call<'ob>( &self, frame: &mut CallFrame<'_, '_>, name: Option<&str>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Trait Implementations§

Source§

impl Drop for CallFrame<'_, '_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'rt> Deref for CallFrame<'_, 'rt>

Source§

type Target = Rt<Env<'rt>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for CallFrame<'_, '_>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'brw, 'rt> Freeze for CallFrame<'brw, 'rt>

§

impl<'brw, 'rt> !RefUnwindSafe for CallFrame<'brw, 'rt>

§

impl<'brw, 'rt> !Send for CallFrame<'brw, 'rt>

§

impl<'brw, 'rt> !Sync for CallFrame<'brw, 'rt>

§

impl<'brw, 'rt> Unpin for CallFrame<'brw, 'rt>

§

impl<'brw, 'rt> !UnwindSafe for CallFrame<'brw, 'rt>

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, 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
§

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

§

fn vzip(self) -> V

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.