pub enum Routed<'a, M, R, N> {
Request {
method: M,
id: WireId<'a>,
params: R,
},
Notification {
method: M,
params: N,
},
Reply {
id: WireId<'a>,
payload: ReplyPayload<'a>,
},
}Expand description
A routed message: the method it names and its params, already typed.
R and N are the request and notification params, which are different
types because a request and a notification of the same method legitimately
have different params. The reply arm carries neither, which is why there is
no parameter for it.
Variants§
Request
A request, which expects a reply carrying this id.
Notification
A notification, which expects nothing.
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
§
payload: ReplyPayload<'a>The reply payload, undecoded.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a, M, R, N> Freeze for Routed<'a, M, R, N>
impl<'a, M, R, N> RefUnwindSafe for Routed<'a, M, R, N>
impl<'a, M, R, N> Send for Routed<'a, M, R, N>
impl<'a, M, R, N> Sync for Routed<'a, M, R, N>
impl<'a, M, R, N> Unpin for Routed<'a, M, R, N>
impl<'a, M, R, N> UnsafeUnpin for Routed<'a, M, R, N>
impl<'a, M, R, N> UnwindSafe for Routed<'a, M, R, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more