pub struct KopiaClientBuilder { /* private fields */ }Expand description
Builder for KopiaClient.
Implementations§
Source§impl KopiaClientBuilder
impl KopiaClientBuilder
Sourcepub fn binary(self, binary: impl Into<PathBuf>) -> Self
pub fn binary(self, binary: impl Into<PathBuf>) -> Self
Set the path to the kopia binary. Injectable so tests can point at a
fake shim. Defaults to kopia (resolved via PATH).
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add an environment variable applied to every invocation. Use this for
KOPIA_PASSWORD, KOPIA_CONFIG_PATH, cache dirs, and S3 credentials.
Sourcepub fn env_remove(self, key: impl Into<String>) -> Self
pub fn env_remove(self, key: impl Into<String>) -> Self
Record an environment variable to UNSET on every spawned command
(Command::env_remove), mirroring the None half of the
per-invocation overlay semantics (see run_with_env: Some(v) sets,
None unsets). Use this to keep an ambient/inherited credential from
leaking into a client that must not see it (e.g. the source
KOPIA_PASSWORD on a destination-configured replication client).
Applied AFTER Self::env, so a key both set and removed ends up
unset; a later per-invocation overlay Some(v) still wins.
Sourcepub fn common_arg(self, arg: impl Into<String>) -> Self
pub fn common_arg(self, arg: impl Into<String>) -> Self
Add a global arg applied (after the subcommand tokens) to every
invocation. Must be a flag kopia accepts on every subcommand (e.g. a
global flag); per-subcommand flags belong on the specific method.
Prefer env vars (e.g. KOPIA_CHECK_FOR_UPDATES=false) for cross-cutting
behavior.
Sourcepub fn default_timeout(self, timeout: Duration) -> Self
pub fn default_timeout(self, timeout: Duration) -> Self
Default per-invocation timeout. None means no timeout.
Sourcepub fn build(self) -> KopiaClient
pub fn build(self) -> KopiaClient
Finalize.
Trait Implementations§
Source§impl Clone for KopiaClientBuilder
impl Clone for KopiaClientBuilder
Source§fn clone(&self) -> KopiaClientBuilder
fn clone(&self) -> KopiaClientBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more