pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(server: impl Into<String>) -> Self
pub fn new(server: impl Into<String>) -> Self
Start a builder for the given server base URL
(e.g. http://localhost:8080).
Sourcepub fn from_cloacinactl_profile(
home: Option<&Path>,
profile: Option<&str>,
) -> Result<Self, ClientError>
pub fn from_cloacinactl_profile( home: Option<&Path>, profile: Option<&str>, ) -> Result<Self, ClientError>
Build from a cloacinactl profile in ~/.cloacina/config.toml
(or home/config.toml when home is given). Resolves env: and
file: API-key schemes exactly like the CLI.
Sourcepub fn api_key(self, key: impl Into<String>) -> Self
pub fn api_key(self, key: impl Into<String>) -> Self
API key, sent as Authorization: Bearer <key> on every request.
Sourcepub fn tenant(self, tenant: impl Into<String>) -> Self
pub fn tenant(self, tenant: impl Into<String>) -> Self
Default tenant for tenant-scoped calls (defaults to public —
the admin-schema tenant the server treats specially).
Sourcepub fn connect_timeout(self, d: Duration) -> Self
pub fn connect_timeout(self, d: Duration) -> Self
Connect timeout (default 5s).
pub fn build(self) -> Result<Client, ClientError>
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
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 ClientBuilder
impl Debug for ClientBuilder
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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