pub struct CloseRouteOptions {
pub scope: Option<ScopeSelector>,
pub drain: bool,
pub drain_timeout: Duration,
pub consumer_identity: Option<ConsumerIdentity>,
pub reverse_requests: ReverseRequestRegistry,
pub role_versions: Option<BTreeMap<String, String>>,
}Expand description
Options for SubcConsumer::close_route.
Fields§
§scope: Option<ScopeSelector>Scope used to open the cached route. Defaults to None, which selects
only the unscoped entry; other scopes and epochs are never closed here.
SubcConsumer::close_handle rejects this option because the handle
already selects exactly one route.
drain: boolAwait in-flight unary requests on the route to settle naturally before tearing it down. Defaults to false: close immediately, settling anything in flight as at-most-once failures (outcome_unknown if already sent, not_sent otherwise).
drain_timeout: DurationUpper bound on the drain wait (ignored when drain is false).
consumer_identity: Option<ConsumerIdentity>Override for the consumer identity used to locate the route being closed;
when absent, the supervised launch identity identifies the route, except
on connections created by SubcConsumer::connect_operator_app.
On claim-bound connections, a legacy nonce identity conflicts with the
binding; close_route refuses it by doing nothing.
reverse_requests: ReverseRequestRegistryReverse-request handlers plus extra capability strings added through
Self::with_consumer_capability. Together, they identify the route being closed.
role_versions: Option<BTreeMap<String, String>>The role versions the route being closed was opened with (see
CallOptions::role_versions); part of the route’s identity.
Implementations§
Source§impl CloseRouteOptions
impl CloseRouteOptions
Sourcepub fn with_consumer_capability(
self,
capability: impl Into<String>,
) -> Result<Self, ConsumerCapabilityError>
pub fn with_consumer_capability( self, capability: impl Into<String>, ) -> Result<Self, ConsumerCapabilityError>
Add a provider-contract capability declaration to the route identity.
Values are merged with the reverse-request families. For example,
tool-result/v1 declares the tool-provider content result format; the
declaration is not verified and grants no privilege.
Like reverse-request handlers, declarations are kept in the options’ shared reverse-request state, so options cloned before this call share the declaration. Add declarations before cloning options for other routes.
Sourcepub fn consumer_capabilities(&self) -> Vec<String>
pub fn consumer_capabilities(&self) -> Vec<String>
The extra capability strings added with with_consumer_capability, not
the reverse-request handler families. For example, tool-result/v1 declares
tool-provider content-result support; declarations are unverified and
grant nothing.