Trait fibers_rpc::Cast[][src]

pub trait Cast: Sized + Sync + Send + 'static {
    type Notification: Send + 'static;
    type Encoder: Encode<Item = Self::Notification> + Send + 'static;
    type Decoder: Decode<Item = Self::Notification> + Send + 'static;

    const ID: ProcedureId;
    const NAME: &'static str;
    fn enable_async(notification: &Self::Notification) -> bool { ... }
fn client(service: &ClientServiceHandle) -> CastClient<Self>
    where
        Self::Encoder: Default
, { ... }
fn client_with_encoder(
        service: &ClientServiceHandle,
        encoder: Self::Encoder
    ) -> CastClient<Self> { ... } }

Notification RPC.

Associated Types

Notification message.

Notification message encoder.

Notification 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 notification 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 encoder maker.

Implementors