pub struct ConnectionScope<'a> { /* private fields */ }Expand description
A connection-scoped handle. The engine (ConnectionScope::run) executes
declarative Operations against this connection.
Implementations§
Source§impl ConnectionScope<'_>
impl ConnectionScope<'_>
Sourcepub async fn run<O: IntoOperation>(
&self,
operation: O,
) -> Result<CallResponse<O::Output>, Error>
pub async fn run<O: IntoOperation>( &self, operation: O, ) -> Result<CallResponse<O::Output>, Error>
The engine: resolves and executes a declarative Operation against
this connection. Signs the request with the secret + connection-key +
action-id headers, applies the operation’s retry/timeout policy (or the
client defaults), retries transient HTTP failures (network, 5xx, 429,
and any retry_on statuses) honoring Retry-After, and fires the
client + per-call success/error hooks.
Sourcepub async fn get(&self) -> Result<Connection, Error>
pub async fn get(&self) -> Result<Connection, Error>
Fetches this connection’s record from the vault by key, including its
metadata. Returns Error::NotFound if no connection matches.
The lookup happens within the client’s tenant scope, not across every
tenant. A secret key carries its tenant server-side, so this is
scope-agnostic for one. A bearer is not: the vault resolves the tenant
from the request’s headers, so a client built without
OneBuilder::organization looks in the user’s personal connections
and an organization-owned connection reads as absent.