Trait fibers_rpc::Call [] [src]

pub trait Call: Sized + Send + Sync + 'static {
    type Req: Send + 'static;
    type ReqEncoder: Encode<Item = Self::Req> + Send + 'static;
    type ReqDecoder: Decode<Item = Self::Req> + Send + 'static;
    type Res: Send + 'static;
    type ResEncoder: Encode<Item = Self::Res> + Send + 'static;
    type ResDecoder: Decode<Item = Self::Res> + Send + 'static;

    const ID: ProcedureId;
    const NAME: &'static str;
    fn enable_async_request(request: &Self::Req) -> bool { ... }
fn enable_async_response(response: &Self::Res) -> bool { ... }
fn client(service: &ClientServiceHandle) -> CallClient<Self>
    where
        Self::ReqEncoder: Default,
        Self::ResDecoder: Default
, { ... }
fn client_with_decoder(
        service: &ClientServiceHandle,
        decoder: Self::ResDecoder
    ) -> CallClient<Self>
    where
        Self::ReqEncoder: Default
, { ... }
fn client_with_encoder(
        service: &ClientServiceHandle,
        encoder: Self::ReqEncoder
    ) -> CallClient<Self>
    where
        Self::ResDecoder: Default
, { ... }
fn client_with_codec(
        service: &ClientServiceHandle,
        decoder: Self::ResDecoder,
        encoder: Self::ReqEncoder
    ) -> CallClient<Self> { ... } }

Request/response RPC.

Associated Types

Request message.

Request message encoder.

Request message decoder.

Response message.

Response message encoder.

Response message decoder.

Associated Constants

The identifier of the procedure.

The name of the procedure.

This is only used for debugging purpose.

Provided Methods

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.

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.

Makes a new RPC client.

Makes a new RPC client with the given decoder maker.

Makes a new RPC client with the given encoder maker.

Makes a new RPC client with the given decoder and encoder makers.

Implementors