Trait gluon_vm::api::AsyncPushable
source · pub trait AsyncPushable<'vm> {
// Required method
fn async_push(
self,
context: &mut ActiveThread<'vm>,
lock: Lock,
frame_index: VmIndex
) -> Poll<Result<()>>;
// Provided method
fn async_status_push(
self,
context: &mut ActiveThread<'vm>,
lock: Lock,
frame_index: VmIndex
) -> Status
where Self: Sized { ... }
}
Expand description
Trait which allows a possibly asynchronous rust value to be pushed to the virtual machine
Required Methods§
sourcefn async_push(
self,
context: &mut ActiveThread<'vm>,
lock: Lock,
frame_index: VmIndex
) -> Poll<Result<()>>
fn async_push( self, context: &mut ActiveThread<'vm>, lock: Lock, frame_index: VmIndex ) -> Poll<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.
If the value must be computed asynchronously Poll::Pending
must be returned so that
the virtual machine knows it must do more work before the value is available.