pub struct RequestClient { /* private fields */ }Expand description
Request entry point bound to one session. It constructs requests and exposes snapshots of requests awaiting responses.
Implementations§
Source§impl RequestClient
impl RequestClient
Sourcepub fn request_with_factory<F>(
&self,
key: impl Into<String>,
factory: F,
) -> Result<WsRequestOperationBuilder>
pub fn request_with_factory<F>( &self, key: impl Into<String>, factory: F, ) -> Result<WsRequestOperationBuilder>
Creates a logical operation. The factory must encode both context IDs; response routing must extract the current attempt’s wire request ID.
Source§impl RequestClient
impl RequestClient
Sourcepub fn session_id(&self) -> SessionId
pub fn session_id(&self) -> SessionId
Returns the logical session identifier for this request entry point.
Sourcepub fn request(&self, request: Request) -> RequestBuilder
pub fn request(&self, request: Request) -> RequestBuilder
Creates a builder for a request owned by this session.
Sourcepub async fn execute(&self, request: Request) -> Result<Response>
pub async fn execute(&self, request: Request) -> Result<Response>
Enqueues a request and waits for its final response.
The returned error covers admission, local writing, cancellation, and response timeout; a successful response means the response was routed to this request, not that any separate application side effect is committed.
Sourcepub fn pending_snapshot(&self) -> Result<Vec<RequestSnapshot>>
pub fn pending_snapshot(&self) -> Result<Vec<RequestSnapshot>>
Returns snapshots of requests currently waiting for responses.
Trait Implementations§
Source§impl Clone for RequestClient
impl Clone for RequestClient
Auto Trait Implementations§
impl !RefUnwindSafe for RequestClient
impl !UnwindSafe for RequestClient
impl Forget for RequestClient
impl Freeze for RequestClient
impl Move for RequestClient
impl Send for RequestClient
impl Sync for RequestClient
impl Unpin for RequestClient
impl UnsafeUnpin for RequestClient
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