pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Start building a client for the given server base URL, e.g.
http://127.0.0.1:8000. A configured server prefix (e.g.
/datapress) should be included here.
Sourcepub fn api_base(self, base: impl Into<String>) -> Self
pub fn api_base(self, base: impl Into<String>) -> Self
Override the versioned API mount path. Defaults to /api/v1; pass
/api to target the legacy unversioned alias.
Sourcepub fn admin_token(self, token: impl Into<String>) -> Self
pub fn admin_token(self, token: impl Into<String>) -> Self
Set the admin token sent as X-Admin-Token on mutating endpoints
(currently Client::reload).
Sourcepub fn bearer_token(self, token: impl Into<String>) -> Self
pub fn bearer_token(self, token: impl Into<String>) -> Self
Set an OAuth2 bearer token, attached as Authorization: Bearer …
to every request (for servers with auth enabled).
Sourcepub fn reqwest_builder(self, b: ClientBuilder) -> Self
pub fn reqwest_builder(self, b: ClientBuilder) -> Self
Provide a pre-configured reqwest::ClientBuilder to customise
the underlying HTTP client (proxies, TLS, pools, …).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Freeze for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin 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