[−][src]Struct fizyr_rpc::ReceivedRequest
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
impl<Body> ReceivedRequest<Body>
[src]
pub fn request_id(&self) -> u32
[src]
Get the request ID of the received request.
pub fn service_id(&self) -> i32
[src]
Get the service ID of the initial request message.
pub fn body(&self) -> &Body
[src]
Get the body of the initial request message.
pub async fn next_message(&mut self) -> Result<Message<Body>, ReadMessageError>
[src]
Receive the next message from the request.
This can only be an update message.
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.
pub async fn send_response(
self,
service_id: i32,
body: impl Into<Body>
) -> Result<(), WriteMessageError>
[src]
self,
service_id: i32,
body: impl Into<Body>
) -> Result<(), WriteMessageError>
Send the final response.
pub async fn send_error_response(
self,
message: &str
) -> Result<(), WriteMessageError> where
Body: Body,
[src]
self,
message: &str
) -> Result<(), WriteMessageError> where
Body: Body,
Send the final response with an error message.
Trait Implementations
Auto Trait Implementations
impl<Body> !RefUnwindSafe for ReceivedRequest<Body>
[src]
impl<Body> Send for ReceivedRequest<Body> where
Body: Send,
[src]
Body: Send,
impl<Body> Sync for ReceivedRequest<Body> where
Body: Send + Sync,
[src]
Body: Send + Sync,
impl<Body> Unpin for ReceivedRequest<Body> where
Body: Unpin,
[src]
Body: Unpin,
impl<Body> !UnwindSafe for ReceivedRequest<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>,