pub trait Call<'wire, T, E>: MaybeSend{
// Required method
fn reply(self, result: Result<T, E>) -> impl Future<Output = ()> + MaybeSend;
// Provided methods
fn ok(self, value: T) -> impl Future<Output = ()> + MaybeSend
where Self: Sized { ... }
fn err(self, error: E) -> impl Future<Output = ()> + MaybeSend
where Self: Sized { ... }
}Expand description
Represents an in-progress API-level call as seen by a server handler.
A Call is handed to a Handler implementation for one incoming
request attempt. It provides the mechanism for sending the terminal
response for that attempt back to the caller. The response can be sent
via Call::reply, Call::ok, or Call::err.
In the retry model, one logical operation may span multiple request
attempts over time, but each Call value corresponds to exactly one
request attempt currently being handled.
§Cancellation
If a Call is dropped without a reply being sent, the caller will
automatically receive a VoxError::Cancelled error. This guarantees
that the caller is always notified, even if the handler panics or
otherwise fails to produce a reply.
§Type Parameters
T: The success value type of the response.E: The error value type of the response.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.