#[non_exhaustive]
pub enum ClientMessage<T> {
    Request(Request<T>),
    Cancel {
        trace_context: Context,
        request_id: u64,
    },
}
Expand description

A message from a client to a server.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

Request(Request<T>)

A request initiated by a user. The server responds to a request by invoking a service-provided request handler. The handler completes with a response, which the server sends back to the client.

Cancel

Fields

trace_context: Context

The trace context associates the message with a specific chain of causally-related actions, possibly orchestrated across many distributed systems.

request_id: u64

The ID of the request to cancel.

A command to cancel an in-flight request, automatically sent by the client when a response future is dropped.

When received, the server will immediately cancel the main task (top-level future) of the request handler for the associated request. Any tasks spawned by the request handler will not be canceled, because the framework layer does not know about them.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. 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.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more