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 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KopiaClientBuilder
impl Debug for KopiaClientBuilder
Source§impl Default for KopiaClientBuilder
impl Default for KopiaClientBuilder
Source§fn default() -> KopiaClientBuilder
fn default() -> KopiaClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for KopiaClientBuilder
impl RefUnwindSafe for KopiaClientBuilder
impl Send for KopiaClientBuilder
impl Sync for KopiaClientBuilder
impl Unpin for KopiaClientBuilder
impl UnsafeUnpin for KopiaClientBuilder
impl UnwindSafe for KopiaClientBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more