pub trait Service:
Serialize
+ DeserializeOwned
+ Send
+ Sync
+ Debug
+ 'static {
type Message: Send + Unpin + 'static;
}Expand description
Trait for a service
This is implemented on the protocol enum. It is usually auto-implemented via the `rpc_requests macro.
A service acts as a scope for defining the tx and rx channels for each message type, and provides some type safety when sending messages.
Required Associated Types§
Sourcetype Message: Send + Unpin + 'static
type Message: Send + Unpin + 'static
Message enum for this protocol.
This is expected to be an enum with identical variant names than the
protocol enum, but its single unit field is the WithChannels struct
that contains the inner request plus the tx and rx channels.
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.