pub struct WithVM<'vm, T> {
pub vm: &'vm Thread,
pub value: T,
}
Expand description
Wrapper type which passes acts as the type T
but also passes the VM
to the called function
Fields
vm: &'vm Thread
value: T
Trait Implementations
sourceimpl<'vm, 'value, T> Getable<'vm, 'value> for WithVM<'vm, T>where
T: Getable<'vm, 'value>,
impl<'vm, 'value, T> Getable<'vm, 'value> for WithVM<'vm, T>where
T: Getable<'vm, 'value>,
fn from_value(vm: &'vm Thread, value: Variants<'value>) -> WithVM<'vm, T>
sourceimpl<'vm, T> Pushable<'vm> for WithVM<'vm, T>where
T: Pushable<'vm>,
impl<'vm, T> Pushable<'vm> for WithVM<'vm, T>where
T: Pushable<'vm>,
sourcefn push(self, context: &mut ActiveThread<'vm>) -> Result<()>
fn push(self, context: &mut ActiveThread<'vm>) -> Result<()>
Pushes
self
to stack
. If the call is successful a single element should have been added
to the stack and Ok(())
should be returned. If the call is unsuccessful Status:Error
should be returned and the stack should be left intact Read morefn status_push(self, context: &mut ActiveThread<'vm>) -> Statuswhere
Self: Sized,
unsafe fn marshal_unrooted(self, vm: &'vm Thread) -> Result<Value>where
Self: Sized,
fn marshal<T>(self, vm: &'vm Thread) -> Result<RootedValue<T>>where
Self: Sized,
T: VmRoot<'vm>,
sourceimpl<'vm, T> VmType for WithVM<'vm, T>where
T: VmType,
impl<'vm, T> VmType for WithVM<'vm, T>where
T: VmType,
type Type = <T as VmType>::Type
type Type = <T as VmType>::Type
A version of
Self
which implements Any
allowing a TypeId
to be retrievedsourcefn extra_args() -> VmIndex
fn extra_args() -> VmIndex
How many extra arguments a function returning this type requires.
Used for abstract types which when used in return position should act like they still need
more arguments before they are called Read more
fn make_forall_type(vm: &Thread) -> ArcType
Auto Trait Implementations
impl<'vm, T> RefUnwindSafe for WithVM<'vm, T>where
T: RefUnwindSafe,
impl<'vm, T> Send for WithVM<'vm, T>where
T: Send,
impl<'vm, T> Sync for WithVM<'vm, T>where
T: Sync,
impl<'vm, T> Unpin for WithVM<'vm, T>where
T: Unpin,
impl<'vm, T> UnwindSafe for WithVM<'vm, T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<'vm, T> AsyncPushable<'vm> for Twhere
T: Pushable<'vm>,
impl<'vm, T> AsyncPushable<'vm> for Twhere
T: Pushable<'vm>,
sourcefn async_push(
self,
context: &mut ActiveThread<'vm>,
_: u32
) -> Result<Async<()>, Error>
fn async_push(
self,
context: &mut ActiveThread<'vm>,
_: u32
) -> Result<Async<()>, Error>
Pushes
self
to stack
. If the call is successful a single element should have been added
to the stack and Ok(())
should be returned. If the call is unsuccessful Status:Error
should be returned and the stack should be left intact. Read morefn async_status_push(
self,
context: &mut ActiveThread<'vm>,
frame_index: VmIndex
) -> Statuswhere
Self: Sized,
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more