#[non_exhaustive]pub struct MarpleDBBuilder { /* private fields */ }Expand description
Builder for MarpleDB.
Implementations§
Source§impl MarpleDBBuilder
impl MarpleDBBuilder
Sourcepub fn url(self, url: impl Into<String>) -> Self
pub fn url(self, url: impl Into<String>) -> Self
Sets the MarpleDB API base URL.
The URL should usually end in /api/v1.
Sourcepub fn token(self, token: impl Into<String>) -> Self
pub fn token(self, token: impl Into<String>) -> Self
Sets the bearer API token.
The token is sent as Authorization: Bearer <token> on API requests.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Sets the timeout for the API and storage HTTP clients built by the SDK.
This only affects clients created by the builder. Caller-provided clients keep their own timeout configuration.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Sets the user agent for HTTP clients built by the SDK.
Sourcepub fn request_source(self, request_source: impl Into<String>) -> Self
pub fn request_source(self, request_source: impl Into<String>) -> Self
Overrides the X-Request-Source header sent on every API request.
The default is sdk/rust:<crate-version>. Higher-level tools built on
top of the SDK should identify themselves so their traffic shows up
distinctly in backend logs and metrics, for example cli/rust:1.2.3
or my-ingester/2.0.0.
Sourcepub fn client(self, client: Client) -> Self
pub fn client(self, client: Client) -> Self
Uses a caller-provided API HTTP client.
The SDK still attaches the MarpleDB authorization header per request.
Sourcepub fn storage_client(self, client: Client) -> Self
pub fn storage_client(self, client: Client) -> Self
Uses a caller-provided storage HTTP client.
This client is used for pre-signed direct storage URLs and should not include MarpleDB authorization headers by default.
Trait Implementations§
Source§impl Clone for MarpleDBBuilder
impl Clone for MarpleDBBuilder
Source§fn clone(&self) -> MarpleDBBuilder
fn clone(&self) -> MarpleDBBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more