pub struct RequestHandle<R: ServiceRole> {
pub rx: Receiver<Result<R::PeerResp, ServiceError>>,
pub options: PeerRequestOptions,
pub peer: Peer<R>,
pub id: RequestId,
pub progress_token: ProgressToken,
}Available on crate features
client or server only.Expand description
A handle to a remote request
You can cancel it by call RequestHandle::cancel with a reason,
or wait for response by call RequestHandle::await_response
Fields§
§rx: Receiver<Result<R::PeerResp, ServiceError>>§options: PeerRequestOptions§peer: Peer<R>§id: RequestId§progress_token: ProgressTokenImplementations§
Source§impl<R: ServiceRole> RequestHandle<R>
impl<R: ServiceRole> RequestHandle<R>
pub const REQUEST_TIMEOUT_REASON: &str = "request timeout"
pub async fn await_response(self) -> Result<R::PeerResp, ServiceError>
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for RequestHandle<R>
impl<R> !RefUnwindSafe for RequestHandle<R>
impl<R> Send for RequestHandle<R>
impl<R> Sync for RequestHandle<R>
impl<R> Unpin for RequestHandle<R>
impl<R> !UnwindSafe for RequestHandle<R>
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