pub struct CloudClientBuilder { /* private fields */ }Expand description
Configuration for CloudClient. build() performs no network I/O; the
only side effect is reading/minting ~/.writ/client_id on the first keyless
call (lazily), never at construction.
Implementations§
Source§impl CloudClientBuilder
impl CloudClientBuilder
Sourcepub fn api_key(self, api_key: impl Into<String>) -> Self
pub fn api_key(self, api_key: impl Into<String>) -> Self
Metered API key (wt_/wlk_). Falls back to WRIT_API_KEY; absent ⇒
keyless.
Sourcepub fn cloud_url(self, cloud_url: impl Into<String>) -> Self
pub fn cloud_url(self, cloud_url: impl Into<String>) -> Self
Cloud base URL. Falls back to WRIT_CLOUD_URL, then
https://api.usewrit.app. A trailing / is stripped.
Sourcepub fn client_id(self, client_id: impl Into<String>) -> Self
pub fn client_id(self, client_id: impl Into<String>) -> Self
Override the keyless device/client id (else read/mint ~/.writ/client_id).
Sourcepub fn build(self) -> Result<CloudClient>
pub fn build(self) -> Result<CloudClient>
Build the client, resolving each field from its explicit value, then the matching env var, then the documented default. No network I/O.
Trait Implementations§
Source§impl Clone for CloudClientBuilder
impl Clone for CloudClientBuilder
Source§fn clone(&self) -> CloudClientBuilder
fn clone(&self) -> CloudClientBuilder
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 CloudClientBuilder
impl Debug for CloudClientBuilder
Source§impl Default for CloudClientBuilder
impl Default for CloudClientBuilder
Source§fn default() -> CloudClientBuilder
fn default() -> CloudClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CloudClientBuilder
impl RefUnwindSafe for CloudClientBuilder
impl Send for CloudClientBuilder
impl Sync for CloudClientBuilder
impl Unpin for CloudClientBuilder
impl UnsafeUnpin for CloudClientBuilder
impl UnwindSafe for CloudClientBuilder
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