pub struct ClientConfig { /* private fields */ }Expand description
What a client needs to find and call one service, including how much it trusts its
environment. Pass it to Client::connect_expecting (verified host) or
Client::connect_config (hardened root, unverified host).
The suite root is chosen like this:
suitegiven: that suite, as is. Withignore_env_overrideson, a suite that came from the environment (Suite::resolve, seeSuite::env_derived) is refused, so the switch cannot be defeated by passingSuite::resolve()in.- not given,
ignore_env_overridesoff:Suite::resolve, which honoursRIGHTKIT_SUITE_ROOT,RIGHT_SUITE_DIR,ORTHIC_SHARED_DIRandHOME/XDG_DATA_HOME/LOCALAPPDATA. For QA builds and isolated dev profiles. - not given,
ignore_env_overrideson:Suite::per_user_default, from the account database. For release builds. A launcher that sets environment variables cannot redirect the client.
A host that wants the same switch calls Suite::resolve_ignoring_env_overrides; the host
functions themselves take the suite as an argument and read no environment variable.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new(service: impl Into<String>, app: impl Into<String>) -> Self
pub fn new(service: impl Into<String>, app: impl Into<String>) -> Self
Talk to service as app, with the DEFAULT_DEADLINE, the suite resolved from the
environment, and no hardening. Release builds should add
ignore_env_overrides(true).
Sourcepub fn secret(self, secret: PrivateSecret) -> Self
pub fn secret(self, secret: PrivateSecret) -> Self
Send secret on the hello and on every request, for a host that requires one (see
ServiceConfig::private_secret). Pair it with
Client::connect_expecting: a secret goes to whatever answered at the endpoint.
Sourcepub fn deadline(self, deadline: Option<Duration>) -> Self
pub fn deadline(self, deadline: Option<Duration>) -> Self
Per-request deadline, as for Client::connect_with (None = unbounded).
Sourcepub fn ignore_env_overrides(self, ignore: bool) -> Self
pub fn ignore_env_overrides(self, ignore: bool) -> Self
Refuse environment redirection: the suite root comes only from the per-user default
(Suite::per_user_default), and an explicit suite that was derived from
the environment is an error. Release builds of an app and of its command-line engine set
this; QA builds and isolated test runs do not (they need RIGHTKIT_SUITE_ROOT).
pub fn service(&self) -> &str
pub fn app(&self) -> &str
Sourcepub fn ignores_env_overrides(&self) -> bool
pub fn ignores_env_overrides(&self) -> bool
Whether ignore_env_overrides is on.
Sourcepub fn resolve_suite(&self) -> Result<Suite, SuiteError>
pub fn resolve_suite(&self) -> Result<Suite, SuiteError>
The suite this configuration connects through, per the rules on ClientConfig.