Skip to main content

PluginConfigMap

Type Alias PluginConfigMap 

Source
pub type PluginConfigMap = HashMap<String, HashMap<String, Value>>;
Expand description

Mapping of plugin service names to their properties specified in plugin configuration.

§Example:

Assume plugin configuration YAML has the following content:

plugin_config.yaml:

service_name:
  http_server:
    url: "www.example.com"

Mapping for such config is supposed to look like:

use std::collections::HashMap;

let plugin_config = HashMap::from([(
    // Name of the service
    "service_name".to_string(),

    // Mapping of properties corresponding to the service
    HashMap::from([(
        "http_server".to_string(),
        serde_yaml::to_value(HashMap::from([(
            "url".to_string(),
            // URL is overridden for testing.
            "localhost:29092".to_string(),
        )]))
        .unwrap(),
    )]),
)]);

Aliased Type§

pub struct PluginConfigMap { /* private fields */ }