pub struct ResourceRequestHandle { /* private fields */ }Expand description
Owned handle for a resource provider request selected for handling.
The handle may be sent to another thread for deferred completion. It is
one-shot: call complete once to provide a response, or close/drop it to
release the provider’s reference without completing.
Implementations§
Source§impl ResourceRequestHandle
impl ResourceRequestHandle
Sourcepub fn complete(&self, response: ResourceResponse) -> Result<()>
pub fn complete(&self, response: ResourceResponse) -> Result<()>
Completes the request. A completion attempt that reaches native code closes this handle, even when native reports a non-OK status. Binding validation failures that happen before native code is called leave the handle live so completion can be retried with a valid response.
When a provider callback completes inline and then returns
ResourceProviderDecision::PassThrough, the wrapper still returns the
native Handle decision. Native code must not also pass the completed
request through to its own networking path.
Sourcepub fn is_cancelled(&self) -> Result<bool>
pub fn is_cancelled(&self) -> Result<bool>
Reports whether native code has cancelled the request.