Document `resume_execution` on conditions for `is_resumable` and `resumable_value_type`
This commit is contained in:
parent
9044d42064
commit
add6037e10
|
@ -266,6 +266,13 @@ impl<'args> FuncInvocation<'args> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resume an execution if a previous trap of Host kind happened.
|
/// Resume an execution if a previous trap of Host kind happened.
|
||||||
|
///
|
||||||
|
/// `return_val` must be of the value type [`resumable_value_type`], defined by the host function import. Otherwise,
|
||||||
|
/// `UnexpectedSignature` trap will be returned. The current invocation must also be resumable
|
||||||
|
/// [`is_resumable`]. Otherwise, a `NotResumable` error will be returned.
|
||||||
|
///
|
||||||
|
/// [`resumable_value_type`]: struct.FuncInvocation.html#method.resumable_value_type
|
||||||
|
/// [`is_resumable`]: struct.FuncInvocation.html#method.is_resumable
|
||||||
pub fn resume_execution<'externals, E: Externals + 'externals>(&mut self, return_val: Option<RuntimeValue>, externals: &'externals mut E) -> Result<Option<RuntimeValue>, ResumableError> {
|
pub fn resume_execution<'externals, E: Externals + 'externals>(&mut self, return_val: Option<RuntimeValue>, externals: &'externals mut E) -> Result<Option<RuntimeValue>, ResumableError> {
|
||||||
match self.kind {
|
match self.kind {
|
||||||
FuncInvocationKind::Internal(ref mut interpreter) => {
|
FuncInvocationKind::Internal(ref mut interpreter) => {
|
||||||
|
|
Loading…
Reference in New Issue