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>

source

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 actually BufferTooShort.
  • QueueEmpty is returned if the result was actually QueueEmpty.

In case of any error, because the MethodCall is consumed, the method call is cancelled.

Trait Implementations§

source§

impl<'invoker> Debug for InvokeEndResult<'invoker>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'invoker> PartialEq for InvokeEndResult<'invoker>

source§

fn eq(&self, other: &InvokeEndResult<'invoker>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'invoker> Eq for InvokeEndResult<'invoker>

source§

impl<'invoker> StructuralPartialEq for InvokeEndResult<'invoker>

Auto Trait Implementations§

§

impl<'invoker> Freeze for InvokeEndResult<'invoker>

§

impl<'invoker> RefUnwindSafe for InvokeEndResult<'invoker>

§

impl<'invoker> Send for InvokeEndResult<'invoker>

§

impl<'invoker> Sync for InvokeEndResult<'invoker>

§

impl<'invoker> Unpin for InvokeEndResult<'invoker>

§

impl<'invoker> !UnwindSafe for InvokeEndResult<'invoker>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.