pub trait AdapterConfig:
JsonSchema
+ Serialize
+ DeserializeOwned
+ Sized {
const PORT: Port;
const KIND: &'static str;
// Required method
fn example() -> Self;
// Provided methods
fn from_options(options: Options) -> Result<Self, OptionsError> { ... }
fn description() -> AdapterDescription { ... }
}Expand description
An adapter’s configuration type: its port, its kind, and an example.
The provided description and
from_options are what the composition root uses;
adapters implement only the three required items, usually through
#[derive(AdapterConfig)].
Required Associated Constants§
Required Methods§
Provided Methods§
Sourcefn from_options(options: Options) -> Result<Self, OptionsError>
fn from_options(options: Options) -> Result<Self, OptionsError>
Turn a port entry’s options into this config, strictly.
Sourcefn description() -> AdapterDescription
fn description() -> AdapterDescription
Everything the composition root renders from this declaration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".