Skip to main content

MsgFamily

Trait MsgFamily 

Source
pub trait MsgFamily: 'static {
    type Msg<'a>: Facet<'a> + 'a;

    // Provided methods
    fn shape() -> &'static Shape { ... }
    fn rpc_plan() -> &'static RpcPlan { ... }
}
Expand description

Maps a lifetime to a concrete message type.

Rust doesn’t have higher-kinded types, so this trait bridges the gap: F::Msg<'a> gives you the message type for any lifetime 'a.

The send path uses Msg<'a> (borrowed data serialized in place). The recv path uses Msg<'static> (owned, via SelfRef).

Required Associated Types§

Source

type Msg<'a>: Facet<'a> + 'a

Provided Methods§

Source

fn shape() -> &'static Shape

Source

fn rpc_plan() -> &'static RpcPlan

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.

Implementors§