Skip to main content

AdapterConfig

Trait AdapterConfig 

Source
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 index_schema() -> Option<AdapterSchema> { ... }
    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§

Source

const PORT: Port

Which port this adapter implements.

Source

const KIND: &'static str

The type = "…" token that selects this adapter in flusso.toml.

Required Methods§

Source

fn example() -> Self

A realistic, complete example, rendered into the docs and the schema.

Provided Methods§

Source

fn from_options(options: Options) -> Result<Self, OptionsError>

Turn a port entry’s options into this config, strictly.

Source

fn index_schema() -> Option<AdapterSchema>

The schema of the options this adapter takes per index, under an [[index]] entry’s sinks.<name> table. None (the default) means the adapter takes none, so naming it there is an error. The derive’s index_options = Type key fills it.

Source

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".

Implementors§