Skip to main content

RoutedMessage

Type Alias RoutedMessage 

Source
pub type RoutedMessage<'a, M> = Routed<'a, <M as MethodTable>::MethodId, <M as MethodTable>::RequestParams<'a>, <M as MethodTable>::NotificationParams<'a>>;
Expand description

The same, for a single message.

Aliased Type§

pub enum RoutedMessage<'a, M> {
    Request {
        method: <M as MethodTable>::MethodId,
        id: WireId<'a>,
        params: <M as MethodTable>::RequestParams<'a>,
    },
    Notification {
        method: <M as MethodTable>::MethodId,
        params: <M as MethodTable>::NotificationParams<'a>,
    },
    Reply {
        id: WireId<'a>,
        payload: ReplyPayload<'a>,
    },
}

Variants§

§

Request

A request, which expects a reply carrying this id.

Fields

§method: <M as MethodTable>::MethodId

The method the sender named.

§id: WireId<'a>

The id to answer with.

§params: <M as MethodTable>::RequestParams<'a>

The decoded params.

§

Notification

A notification, which expects nothing.

Fields

§method: <M as MethodTable>::MethodId

The method the sender named.

§params: <M as MethodTable>::NotificationParams<'a>

The decoded params.

§

Reply

A reply, passed through without routing.

Carried rather than dropped because a peer that sent us a result is a peer whose response we were waiting for, and the session engine decides what to match it against. Discarding it here would push that decision down into the transport.

Fields

§id: WireId<'a>

The id the reply answers.

§payload: ReplyPayload<'a>

The reply payload, undecoded.