From add6037e10bf0bad00d6a0aca547282067239615 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Mon, 9 Jul 2018 23:24:05 +0800 Subject: [PATCH] Document `resume_execution` on conditions for `is_resumable` and `resumable_value_type` --- src/func.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/func.rs b/src/func.rs index ea1f136..28e39f3 100644 --- a/src/func.rs +++ b/src/func.rs @@ -266,6 +266,13 @@ impl<'args> FuncInvocation<'args> { } /// 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, externals: &'externals mut E) -> Result, ResumableError> { match self.kind { FuncInvocationKind::Internal(ref mut interpreter) => {