Struct fizyr_rpc::SentRequest [−][src]
A handle for a sent request.
The handle can be used to receive updates and the response from the remote peer, and to send update messages to the remote peer.
Implementations
impl<Body> SentRequest<Body>
[src]
pub fn request_id(&self) -> u32
[src]
Get the request ID of the sent request.
pub fn service_id(&self) -> i32
[src]
Get the service ID of the initial request message.
pub async fn recv_update(
&mut self
) -> Result<Option<Message<Body>>, RecvMessageError>
[src]
&mut self
) -> Result<Option<Message<Body>>, RecvMessageError>
Receive the next update message of the request from the remote peer.
This function returns Ok(None)
if the final response is received instead of an update message.
If that happens, the response message can be read using [Self::response
].
pub async fn recv_response(&mut self) -> Result<Message<Body>, RecvMessageError>
[src]
Receive the final response of the request from the remote peer.
This function returns an InvalidMessageType
if the received message is an update message.
If that happens, the update message can be read using [Self::next_update
].
To ensure that there are no update messages left, keep calling [Self::next_update
] untill it returns Ok(None)
.
pub async fn send_update(
&mut self,
service_id: i32,
body: impl Into<Body>
) -> Result<(), WriteMessageError>
[src]
&mut self,
service_id: i32,
body: impl Into<Body>
) -> Result<(), WriteMessageError>
Send an update for the request to the remote peer.
Trait Implementations
Auto Trait Implementations
impl<Body> !RefUnwindSafe for SentRequest<Body>
[src]
impl<Body> Send for SentRequest<Body> where
Body: Send,
[src]
Body: Send,
impl<Body> Sync for SentRequest<Body> where
Body: Send + Sync,
[src]
Body: Send + Sync,
impl<Body> Unpin for SentRequest<Body> where
Body: Unpin,
[src]
Body: Unpin,
impl<Body> !UnwindSafe for SentRequest<Body>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,