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 call from a client that must be replied to.
A Call is handed to a Handler implementation and provides the
mechanism for sending a response back to the caller. The response can
be sent via Call::reply, Call::ok, or Call::err.
§Cancellation
If a Call is dropped without a reply being sent, the caller will
automatically receive a RoamError::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.