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>
impl<'brw, 'rt> CallFrame<'brw, 'rt>
Sourcepub(crate) fn new(env: &'brw mut Rt<Env<'rt>>) -> Self
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.
Sourcepub(crate) fn new_with_args(env: &'brw mut Rt<Env<'rt>>, args: usize) -> Self
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.
Sourcepub(crate) fn push_arg(&mut self, arg: impl IntoRoot<Slot<Gc<ObjectType<'rt>>>>)
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
Sourcepub(crate) fn finalize_arguments(&mut self)
pub(crate) fn finalize_arguments(&mut self)
Set the total argument count before a function call
pub(crate) fn arg_count(&self) -> usize
pub(crate) fn arg_slice(&self) -> &[Rt<Slot<Gc<ObjectType<'rt>>>>]
Sourcepub(crate) fn push_arg_slice(&mut self, src: &[Gc<ObjectType<'_>>])
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>>>§
fn inner(&self) -> &T
fn inner_mut(&mut self) -> &mut T
fn inner_ptr(&self) -> *const T
fn inner_mut_ptr(&mut self) -> *mut T
pub(crate) fn bind_ref<'a, 'ob>(
&'a self,
_: &'ob Context<'_>,
) -> &'a <T as WithLifetime<'ob>>::Outwhere
T: WithLifetime<'ob>,
pub(crate) fn bind_mut<'a, 'ob>(
&'a mut self,
_: &'ob Context<'_>,
) -> &'a mut <T as WithLifetime<'ob>>::Outwhere
T: WithLifetime<'ob>,
pub(crate) fn set<U: IntoRoot<T>>(&mut self, item: U)
pub(crate) fn bind<'ob>(
&self,
_: &'ob Context<'_>,
) -> <T as WithLifetime<'ob>>::Outwhere
T: WithLifetime<'ob> + Copy,
pub(crate) unsafe fn bind_unchecked<'ob>(
&'ob self,
) -> <T as WithLifetime<'ob>>::Outwhere
T: WithLifetime<'ob> + Copy,
Sourcepub(crate) fn untag<'ob, U>(&self, cx: &'ob Context<'_>) -> U
pub(crate) fn untag<'ob, U>(&self, cx: &'ob Context<'_>) -> U
Calls untag on the tagged Gc pointer
Sourcepub(crate) fn try_as<U, E>(&self) -> Result<&Rt<Slot<Gc<U>>>, E>
pub(crate) fn try_as<U, E>(&self) -> Result<&Rt<Slot<Gc<U>>>, E>
Like try_into
, but needed to due no specialization
Sourcepub(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,
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
Sourcepub(crate) fn cast<U>(&self) -> &Rt<Slot<Gc<U>>>
pub(crate) fn cast<U>(&self) -> &Rt<Slot<Gc<U>>>
Like Into
, but needed to due no specialization
pub(crate) fn as_cons(&self) -> &Rt<Slot<Gc<&Cons>>>
pub(crate) fn try_as_option<T, E>(&self) -> Result<Option<&Rt<Slot<Gc<T>>>>, E>
pub(crate) fn car<'ob>(&self, cx: &'ob Context<'_>) -> Gc<ObjectType<'ob>>
pub(crate) fn cdr<'ob>(&self, cx: &'ob Context<'_>) -> Gc<ObjectType<'ob>>
fn as_mut_ref(&mut self) -> &mut Vec<Rt<T>>
pub(crate) fn push<U: IntoRoot<T>>(&mut self, item: U)
pub(crate) fn truncate(&mut self, len: usize)
pub(crate) fn pop(&mut self)
pub(crate) fn swap_remove(&mut self, index: usize)
pub(crate) fn reserve(&mut self, additional: usize)
pub(crate) fn capacity(&self) -> usize
pub(crate) fn extend_from_slice<U: IntoRoot<T> + Copy>(&mut self, src: &[U])
pub(crate) fn extend_from_within(&mut self, src: impl RangeBounds<usize>)
fn as_ref(&self) -> &IndexMap<K, V>
fn as_mut(&mut self) -> &mut IndexMap<K, V>
pub(crate) fn insert<Kx: IntoRoot<K>, Vx: IntoRoot<V>>(&mut self, k: Kx, v: Vx)
pub(crate) fn get<Q: IntoRoot<K>>(&self, k: Q) -> Option<&Rt<V>>
pub(crate) fn get_mut<Q: IntoRoot<K>>(&mut self, k: Q) -> Option<&mut Rt<V>>
pub(crate) fn remove<Q: IntoRoot<K>>(&mut self, k: Q)
pub(crate) fn call<'ob>( &self, frame: &mut CallFrame<'_, '_>, name: Option<&str>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>
Trait Implementations§
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> 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