#[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
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§
Source§impl<T: Debug> Debug for ClientMessage<T>
impl<T: Debug> Debug for ClientMessage<T>
Source§impl<'de, T> Deserialize<'de> for ClientMessage<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ClientMessage<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for ClientMessage<T>where
T: Freeze,
impl<T> RefUnwindSafe for ClientMessage<T>where
T: RefUnwindSafe,
impl<T> Send for ClientMessage<T>where
T: Send,
impl<T> Sync for ClientMessage<T>where
T: Sync,
impl<T> Unpin for ClientMessage<T>where
T: Unpin,
impl<T> UnwindSafe for ClientMessage<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more