pub struct AndThenAsyncCaller<Out: for<'de> ArgumentDecoder<'de> + Send, Out2: for<'de> ArgumentDecoder<'de> + Send, Inner: AsyncCall<Out> + Send, R: Future<Output = Result<Out2, AgentError>> + Send, AndThen: Send + Fn(Out) -> R> { /* private fields */ }
Expand description

An AsyncCall that applies a transform function to the result of the call. Because of constraints on the type system in Rust, both the input and output to the function must be deserializable.

Implementations§

Equivalent to inner.and_then(and_then).

Trait Implementations§

Execute the call, but returns the RequestId. Waiting on the request Id must be managed by the caller using the Agent directly. Read more
Execute the call, and wait for an answer using a [Waiter] strategy. The return type is encoded in the trait. Read more
Apply a transformation function after the call has been successful. The transformation is applied with the result. Read more
Apply a transformation function after the call has been successful. Equivalent to .and_then(|x| async { map(x) }).
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.