Struct fizyr_rpc::ReceivedRequestHandle
source · pub struct ReceivedRequestHandle<Body> { /* private fields */ }
Expand description
A handle for a received request.
The handle can be used to receive updates from the remote peer, and to send updates and the response to the remote peer.
Implementations§
source§impl<Body> ReceivedRequestHandle<Body>
impl<Body> ReceivedRequestHandle<Body>
sourcepub fn request_id(&self) -> u32
pub fn request_id(&self) -> u32
Get the request ID of the received request.
sourcepub fn service_id(&self) -> i32
pub fn service_id(&self) -> i32
Get the service ID of the received request message.
sourcepub fn write_handle(&self) -> ReceivedRequestWriteHandle<Body>
pub fn write_handle(&self) -> ReceivedRequestWriteHandle<Body>
Create a write handle for this request.
The write handle can be cloned and used even while this handle is mutably borrowed.
sourcepub async fn recv_update(&mut self) -> Option<Message<Body>>
pub async fn recv_update(&mut self) -> Option<Message<Body>>
Receive the next update message of the request from the remote peer.
sourcepub async fn send_update(
&self,
service_id: i32,
body: impl Into<Body>
) -> Result<(), Error>
pub async fn send_update( &self, service_id: i32, body: impl Into<Body> ) -> Result<(), Error>
Send an update for the request to the remote peer.
Trait Implementations§
Auto Trait Implementations§
impl<Body> !RefUnwindSafe for ReceivedRequestHandle<Body>
impl<Body> Send for ReceivedRequestHandle<Body>where
Body: Send,
impl<Body> Sync for ReceivedRequestHandle<Body>where
Body: Send,
impl<Body> Unpin for ReceivedRequestHandle<Body>
impl<Body> !UnwindSafe for ReceivedRequestHandle<Body>
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