Skip to main content

client_for

Function client_for 

Source
pub fn client_for(
    integration: Integration,
    token: String,
    transport: Arc<dyn HttpTransport>,
    gate: &TrustGate,
) -> Result<Box<dyn HostingClient>>
Expand description

Builds the client for integration, over transport, once gate has admitted it.

The gate checks the address against the trust record before anything exists (see crate::trust), and the transport the client gets is wrapped so that no request leaves the integration’s origins. A folder of local notes has no network and skips the gate.

Families without a client return an UnsupportedClient rather than failing here; callers that want to hide the feature altogether gate on kind.capabilities().implemented.