pub trait ApiClientConstructors: Sized {
// Required method
fn from_http_client(http_client: HttpClient) -> Self;
// Provided methods
fn new<S: Into<String>>(api_key: S) -> Result<Self> { ... }
fn new_with_base_url<S: Into<String>>(
api_key: S,
base_url: S,
) -> Result<Self> { ... }
}Expand description
Common trait for API clients with standard constructors
Required Methods§
Sourcefn from_http_client(http_client: HttpClient) -> Self
fn from_http_client(http_client: HttpClient) -> Self
Create a new instance with the HTTP client
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.