pub trait ProviderBuilder:
Sized
+ Default
+ Clone {
type Extension<H: HttpClientExt>: Provider;
type ApiKey: ApiKey;
const BASE_URL: &'static str;
// Required method
fn build<H>(
builder: &ClientBuilder<Self, Self::ApiKey, H>,
) -> Result<Self::Extension<H>, Error>
where H: HttpClientExt;
// Provided method
fn finish<H>(
&self,
builder: ClientBuilder<Self, Self::ApiKey, H>,
) -> Result<ClientBuilder<Self, Self::ApiKey, H>, Error> { ... }
}Expand description
An API provider extension builder, this abstracts over provider-specific builders which are able to configure and produce a given provider’s extension type
See Provider
Required Associated Constants§
Required Associated Types§
Sourcetype Extension<H: HttpClientExt>: Provider
type Extension<H: HttpClientExt>: Provider
Provider extension type built for a concrete HTTP backend.
Required Methods§
Sourcefn build<H>(
builder: &ClientBuilder<Self, Self::ApiKey, H>,
) -> Result<Self::Extension<H>, Error>where
H: HttpClientExt,
fn build<H>(
builder: &ClientBuilder<Self, Self::ApiKey, H>,
) -> Result<Self::Extension<H>, Error>where
H: HttpClientExt,
Build the provider extension from the client builder configuration.
Provided Methods§
Sourcefn finish<H>(
&self,
builder: ClientBuilder<Self, Self::ApiKey, H>,
) -> Result<ClientBuilder<Self, Self::ApiKey, H>, Error>
fn finish<H>( &self, builder: ClientBuilder<Self, Self::ApiKey, H>, ) -> Result<ClientBuilder<Self, Self::ApiKey, H>, Error>
This method can be used to customize the fields of builder before it is used to create
a client. For example, adding default headers
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".