pub struct GleifClientBuilder { /* private fields */ }
Expand description
Builder for configuring and constructing a GleifClient
.
Provides a fluent interface for customizing various aspects of the client before construction, such as the base URL, middleware, and other options.
Implementations§
Source§impl GleifClientBuilder
impl GleifClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new GleifClientBuilder
with default settings.
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Set a custom base URL for the API (replacing the default).
Sourcepub fn reqwest_client(self, client: ReqwestClient) -> Self
pub fn reqwest_client(self, client: ReqwestClient) -> Self
Use a custom reqwest client for the underlying HTTP operations.
Sourcepub fn middleware_builder(self, builder: ClientBuilder) -> Self
pub fn middleware_builder(self, builder: ClientBuilder) -> Self
Use a custom middleware client builder for the underlying HTTP operations.
This is useful when you need to add middleware like retry, logging, etc.
Sourcepub fn build(self) -> Result<GleifClient>
pub fn build(self) -> Result<GleifClient>
Build the GleifClient
with the configured settings.
Consumes the builder to prevent accidental reuse.
§Errors
Returns a GleifError
if the base URL is invalid or the client cannot be constructed.
Trait Implementations§
Source§impl Default for GleifClientBuilder
impl Default for GleifClientBuilder
Source§fn default() -> Self
fn default() -> Self
Create a new GleifClientBuilder
with default settings.