pub struct InboundRequest<T> { /* private fields */ }Expand description
The lower-level inbound RPC request.
Provides access to the request payload (via InboundRequest::data()) and
the response channel (via InboundRequest::respond()).
Currently, the only inbound RPC request the client can receive is
Subscription.
Implementations§
Source§impl<T> InboundRequest<T>where
T: ServiceRequest,
impl<T> InboundRequest<T>where
T: ServiceRequest,
pub fn id(&self) -> MessageId
Sourcepub fn respond(
self,
response: Result<T::Response, T::Error>,
) -> Result<(), ClientError>
pub fn respond( self, response: Result<T::Response, T::Error>, ) -> Result<(), ClientError>
Sends the response back to the Relay. The value is a
Result<T::Response, T::Error> (see [RequestPayload] trait for
details).
Returns an error if the response can’t be serialized, or if the underlying channel is closed.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for InboundRequest<T>where
T: Freeze,
impl<T> RefUnwindSafe for InboundRequest<T>where
T: RefUnwindSafe,
impl<T> Send for InboundRequest<T>where
T: Send,
impl<T> Sync for InboundRequest<T>where
T: Sync,
impl<T> Unpin for InboundRequest<T>where
T: Unpin,
impl<T> UnwindSafe for InboundRequest<T>where
T: UnwindSafe,
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