Enum oc_wasm_safe::component::InvokeEndResult
source · pub enum InvokeEndResult<'invoker> {
Done(Result<usize, MethodCallError<'invoker>>),
BufferTooShort(MethodCall<'invoker>),
Pending(MethodCall<'invoker>),
}
Expand description
The result of a call to end
.
The 'invoker
lifetime parameter is the lifetime of the method invoker that is performing the
call.
Variants§
Done(Result<usize, MethodCallError<'invoker>>)
The method call is complete and the result has been fetched. If the method call completed
successfully, the Result
value contains the CBOR-encoded result. If the method call
failed, the Result
value contains an error.
BufferTooShort(MethodCall<'invoker>)
The method call is complete but the provided buffer was too short to hold the result. The
MethodCall
value is returned so the caller can retry with a larger buffer.
Pending(MethodCall<'invoker>)
The method call is not finished yet. The MethodCall
value is returned so
the caller can continue to monitor progress.
Implementations§
source§impl<'invoker> InvokeEndResult<'invoker>
impl<'invoker> InvokeEndResult<'invoker>
sourcepub fn expect_done(self) -> Result<usize, MethodCallError<'invoker>>
pub fn expect_done(self) -> Result<usize, MethodCallError<'invoker>>
Unwraps an InvokeEndResult
, assuming that the caller already knows that the result is
Done
. This function is useful if the caller knows that the method call is complete and
that the buffer is large enough to hold any possible return value, or if the caller is not
in a position to handle large return values anyway.
§Errors
BufferTooShort
is returned if the result was actuallyBufferTooShort
.QueueEmpty
is returned if the result was actuallyQueueEmpty
.
In case of any error, because the MethodCall
is consumed, the method call
is cancelled.
Trait Implementations§
source§impl<'invoker> Debug for InvokeEndResult<'invoker>
impl<'invoker> Debug for InvokeEndResult<'invoker>
source§impl<'invoker> PartialEq for InvokeEndResult<'invoker>
impl<'invoker> PartialEq for InvokeEndResult<'invoker>
source§fn eq(&self, other: &InvokeEndResult<'invoker>) -> bool
fn eq(&self, other: &InvokeEndResult<'invoker>) -> bool
self
and other
values to be equal, and is used
by ==
.