pub struct CallOptions {
pub scope: Option<ScopeSelector>,
pub timeout: Duration,
pub priority: Priority,
pub admission_class: AdmissionClass,
pub route_retry: RetryBackoff,
pub route_retry_deadline: Duration,
pub consumer_identity: Option<ConsumerIdentity>,
pub reverse_requests: ReverseRequestRegistry,
pub role_versions: Option<BTreeMap<String, String>>,
}Expand description
Per-call options for SubcConsumer::call.
Fields§
§scope: Option<ScopeSelector>Scope for a managed call’s cached route, including reconnect reopens.
Each owner/ref/epoch has a separate cache entry, apart from unscoped routes.
Admission, retries and terminal refusals follow SubcConsumer::open_route_scoped.
A later call after a scope-related close tries a fresh route; the daemon
refuses it as scope_ended for an old epoch or scope_not_live if the
scope ref is gone. No tombstone is cached.
Defaults to None. Methods using an already-open handle reject this option;
select the scope when opening the route instead.
timeout: DurationDeadline for the whole managed call, including route-open retry and the response wait.
priority: Priority§admission_class: AdmissionClassAdmission behavior stamped into the request frame. Defaults to NORMAL.
route_retry: RetryBackoff§route_retry_deadline: DurationMaximum real-time limit for retrying route.open attempts when the target is temporarily absent. Bounds the whole route open, including the first attempt: a zero budget means no open is attempted. For a single attempt, allow that attempt’s time.
consumer_identity: Option<ConsumerIdentity>Explicit consumer identity for route.open; when absent, the supervised
launch identity is used, except on SubcConsumer::connect_operator_app
connections, which omit implicit identity.
A claim-bound connection rejects legacy nonce identity overrides as not
sent, rather than changing the connection’s authority.
reverse_requests: ReverseRequestRegistryReverse-request handlers plus extra capability strings added with
Self::with_consumer_capability. For example, tool-result/v1 declares
tool-provider content-result support. These declarations are unverified
and grant nothing; both sets are merged and omitted when empty.
role_versions: Option<BTreeMap<String, String>>The versions of provider roles this consumer speaks on the route, role
name to version ({"tool-provider": "v1"}), sent on route.open and
forwarded by the daemon to the provider’s bind. An unverified
declaration that grants nothing. Routes that differ only here are
separate routes, so a legacy route and a versioned one to the same
target are never shared; an empty map is the same as None.
A daemon that does not advertise route-role-versions/v1
(subc_protocol::scope::CAP_ROUTE_ROLE_VERSIONS_V1) drops the field
without telling the provider, so check the capability before relying
on it. A malformed map (see
subc_protocol::session::validate_role_versions) is refused by the
daemon as invalid_request and the call fails as not sent.
Implementations§
Source§impl CallOptions
impl CallOptions
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.
The list is merged with reverse-request handler families, sorted and
de-duplicated. For example, tool-result/v1 declares the tool-provider
content result format. This remains an unverified declaration and grants
no privilege. Invalid values are rejected here, before route.open can be
sent.
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.