pub trait Configuration {
// Required methods
fn from_env() -> Self;
fn with_body(self, value: impl Into<String>) -> Self;
fn with_domain(self, value: impl Into<String>) -> Self;
fn with_identifier(self, value: impl Into<String>) -> Self;
fn token(&self) -> &str;
fn domain(&self) -> &str;
fn identifier(&self) -> Option<&str>;
fn with_params(self, params: Vec<Param>) -> Self;
fn params(&self) -> &[Param];
}Expand description
Trait to standardize configuration loading from environment variables and modification with new values
Required Methods§
Sourcefn from_env() -> Self
fn from_env() -> Self
Populate values from environment (e.g., .env file or environment variables)
Sourcefn with_body(self, value: impl Into<String>) -> Self
fn with_body(self, value: impl Into<String>) -> Self
Return a copy of this configuration with the specified request body payload set
Sourcefn with_domain(self, value: impl Into<String>) -> Self
fn with_domain(self, value: impl Into<String>) -> Self
Return a copy of this configuration with the specified domain set
Sourcefn with_identifier(self, value: impl Into<String>) -> Self
fn with_identifier(self, value: impl Into<String>) -> Self
Return a copy of this configuration with the specified resource identifier set
Sourcefn identifier(&self) -> Option<&str>
fn identifier(&self) -> Option<&str>
Return the optional resource identifier
Sourcefn with_params(self, params: Vec<Param>) -> Self
fn with_params(self, params: Vec<Param>) -> Self
Return a copy of this configuration with custom API parameters set. These are appended to internally-constructed parameters before each request.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".