[−][src]Trait fibers_rpc::Call
Request/response RPC.
Associated Types
type Req: Send + 'static
Request message.
type ReqEncoder: Encode<Item = Self::Req> + Send + 'static
Request message encoder.
type ReqDecoder: Decode<Item = Self::Req> + Send + 'static
Request message decoder.
type Res: Send + 'static
Response message.
type ResEncoder: Encode<Item = Self::Res> + Send + 'static
Response message encoder.
type ResDecoder: Decode<Item = Self::Res> + Send + 'static
Response message decoder.
Associated Constants
const ID: ProcedureId
The identifier of the procedure.
const NAME: &'static str
The name of the procedure.
This is only used for debugging purpose.
Provided methods
fn enable_async_request(request: &Self::Req) -> bool
If it returns true
, encoding/decoding request messages will be executed asynchronously.
For large RPC messages, asynchronous encoding/decoding may improve real-time property
(especially if messages will be encoded/decoded by using serde
).
The default implementation always return false
.
fn enable_async_response(response: &Self::Res) -> bool
If it returns true
, encoding/decoding response messages will be executed asynchronously.
For large RPC messages, asynchronous encoding/decoding may improve real-time property
(especially if messages will be encoded/decoded by using serde
).
The default implementation always return false
.
fn client(service: &ClientServiceHandle) -> CallClient<Self> where
Self::ReqEncoder: Default,
Self::ResDecoder: Default,
Self::ReqEncoder: Default,
Self::ResDecoder: Default,
Makes a new RPC client.
fn client_with_decoder(
service: &ClientServiceHandle,
decoder: Self::ResDecoder
) -> CallClient<Self> where
Self::ReqEncoder: Default,
service: &ClientServiceHandle,
decoder: Self::ResDecoder
) -> CallClient<Self> where
Self::ReqEncoder: Default,
Makes a new RPC client with the given decoder maker.
fn client_with_encoder(
service: &ClientServiceHandle,
encoder: Self::ReqEncoder
) -> CallClient<Self> where
Self::ResDecoder: Default,
service: &ClientServiceHandle,
encoder: Self::ReqEncoder
) -> CallClient<Self> where
Self::ResDecoder: Default,
Makes a new RPC client with the given encoder maker.
fn client_with_codec(
service: &ClientServiceHandle,
decoder: Self::ResDecoder,
encoder: Self::ReqEncoder
) -> CallClient<Self>
service: &ClientServiceHandle,
decoder: Self::ResDecoder,
encoder: Self::ReqEncoder
) -> CallClient<Self>
Makes a new RPC client with the given decoder and encoder makers.