Struct chilli::config::Config [] [src]

pub struct Config { /* fields omitted */ }

The pencil Config type, We provide ways to fill it from JSON files:

let mut app = sharp_pencil::Pencil::new("/demo");
app.config.from_jsonfile("yourconfig.json")

You can also load configurations from an environment variable pointing to a file:

let mut app = sharp_pencil::Pencil::new("/demo");
app.config.from_envvar("YOURAPPLICATION_SETTINGS")

In this case, you have to set this environment variable to the file you want to use. On Linux and OS X you can use the export statement:

export YOURAPPLICATION_SETTINGS="/path/to/config/file"

Methods

impl Config
[src]

[src]

Create a Config object.

[src]

Set a value for the key.

[src]

Returns a reference to the value corresponding to the key.

[src]

Get a boolean configuration value. If the key doesn't exist or the value is not a Json::Boolean, the default value will be returned.

[src]

Loads a configuration from an environment variable pointing to a JSON configuration file.

[src]

Updates the values in the config from a JSON file.

[src]

Updates the values from the given Object.

Trait Implementations

impl Clone for Config
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Config
[src]

[src]

Returns the "default value" for a type. Read more

impl Debug for Config
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Config

impl Sync for Config