pub trait ClientEncoding<Service: ?Sized + 'static>: Sized {
// Required method
fn invoke<R: Serialize + Sync>(
client: &Client<Service>,
method_id: u16,
request: &R,
) -> impl Future<Output = Self> + Send;
}Expand description
Trait for making client calls with automatic encoding/decoding.
This trait is automatically implemented for:
Result<T, anyhow::Error>whereT: DeserializeOwned- unary callsResult<RpcStream<T>, anyhow::Error>- streaming calls
Required 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.
Implementations on Foreign Types§
Source§impl<S: ?Sized + Sync + 'static, T: DeserializeOwned + Send + 'static> ClientEncoding<S> for Result<RpcStream<T>, Error>
Streaming call encoding for RpcStream results.
This impl doesn’t conflict with the above because RpcStream doesn’t impl DeserializeOwned.
impl<S: ?Sized + Sync + 'static, T: DeserializeOwned + Send + 'static> ClientEncoding<S> for Result<RpcStream<T>, Error>
Streaming call encoding for RpcStream results. This impl doesn’t conflict with the above because RpcStream doesn’t impl DeserializeOwned.
Source§impl<S: ?Sized + Sync + 'static, T: DeserializeOwned + Send> ClientEncoding<S> for Result<T, Error>
Unary call encoding for any deserializable Result type.
impl<S: ?Sized + Sync + 'static, T: DeserializeOwned + Send> ClientEncoding<S> for Result<T, Error>
Unary call encoding for any deserializable Result type.