I'm using [config](https://crates.io/crates/config) as a means to load external data into my program which uses [serde](https://crates.io/crates/serde) in the background to deserialize, but I want the ability that a specific field can be one of several types. 
Because I'm quite new to Rust, the [documentation](https://serde.rs/string-or-struct.html) I found doesn't make a lot of sense. 

How can I make it so that `initial_value` can be one of several types:

* `String`
* `i32`
* `bool`
* `[i32,i32]`

I get that I can use the attribute `deserialize_with` to direct to a custom decoder but beyond that I'm a bit at a loss.

Here's my code:

```
use std::collections::HashMap;
use std::fs;

use config_rs::{Config, ConfigError, File};

#[derive(Debug, Deserialize)]
enum InitialValues {
    String,
    i32,
    bool,
}

#[derive(Debug, Deserialize)]
struct Component {
    component: String,
    initial_value: InitialValues,
}

#[derive(Debug, Deserialize)]
struct Template {
    feature_packs: Vec<String>,
    components: Vec<Component>,
}

type Name = String;
type Type = String;

#[derive(Debug, Deserialize)]
pub struct Templates {
    templates: HashMap<Name, Template>,
}

impl Templates {
    pub fn new(file: &str) -> Result<Self, ConfigError> {
        let mut templates = Config::new();
        templates.merge(File::with_name(file)).unwrap();
        templates.try_into()
    }
}

#[derive(Debug)]
pub struct Manager {
    pub templates: HashMap<Type, Templates>,
}

impl Manager {
    pub fn new(dir: &str) -> Self {
        let mut manager = Self {
            templates: HashMap::new(),
        };
        'paths: for raw_path in fs::read_dir(dir).unwrap() {
            let path = raw_path.unwrap().path();
            let file_path = path.clone();
            let type_name = path.clone();
            let templates = match Templates::new(type_name.to_str().unwrap()) {
                Ok(templates) => templates,
                Err(message) => {
                    println!("TemplateManager: file({:?}), {}", &file_path, message);
                    continue 'paths;
                }
            };
            manager.templates.insert(
                file_path.file_stem().unwrap().to_str().unwrap().to_owned(),
                templates,
            );
        }
        manager
    }
}

```

An example config file:

```
---
templates:
  orc:
    feature_packs:
      - physical
      - basic_identifiers_mob
    components:
      - component: char
        initial_value: T
  goblin:
    feature_packs:
      - physical
      - basic_identifiers_mob
    components:
      - component: char
        initial_value: t

```