pub struct RequestHandle { /* private fields */ }Expand description
Shareable handle for observing or explicitly terminating a request.
The handle does not retain the request payload. Clones operate on the same operation, while the registration credential keeps termination scoped to the original registration.
Implementations§
Source§impl RequestHandle
impl RequestHandle
Sourcepub fn id(&self) -> OperationId
pub fn id(&self) -> OperationId
Returns the identifier of the underlying send operation.
Sourcepub fn request_id(&self) -> &RequestId
pub fn request_id(&self) -> &RequestId
Returns the application-level request identifier used for response matching.
Sourcepub fn registration(&self) -> &RequestRegistration
pub fn registration(&self) -> &RequestRegistration
Returns the registration credential associated with this handle.
Sourcepub fn state(&self) -> Result<OperationSnapshot>
pub fn state(&self) -> Result<OperationSnapshot>
Reads a point-in-time snapshot of the request’s send operation.
Sourcepub fn cancel(&self) -> Result<TerminationOutcome>
pub fn cancel(&self) -> Result<TerminationOutcome>
Requests cancellation before delivery, or after delivery while waiting for a response. The returned outcome describes the race with completion.
Sourcepub fn expire(&self) -> Result<TerminationOutcome>
pub fn expire(&self) -> Result<TerminationOutcome>
Marks the request as expired and applies the same race rules as
Self::cancel.
Sourcepub async fn written(&self) -> Result<WriteOutcome>
pub async fn written(&self) -> Result<WriteOutcome>
Waits until the underlying message has completed its local write.
This does not mean that the peer received or processed the message; response completion is reported by the request’s response receiver.