pub struct Config { /* private fields */ }
Expand description

KubOS config used by either Apps or Services. KubOS config files use the TOML format, and can may contain multiple named Categories. Typically each category corresponds to an App or Service name. This allows one config file to store configuration for multiple Apps / Services at a time.

Example KubOS config files for a Service called my-service with an IP/port binding

[my-service]
my-property = "value"

[my-service.addr]
ip = 0.0.0.0
port = 8181

Implementations

Creates and parses configuration data from the system configuration file or the path passed as the ‘-c’ or ‘–config’ option to this executable.

Arguments

name - Category name used as a key in the config file

Creates and parses configuration data from the passed in configuration path.

Arguments

name - Category name used as a key in the config file path - Path to configuration file

Creates and parses configuration data from the passed in configuration string.

Arguments

name - Category name used as a key in the config config - Config data as a string

Returns the configured hosturl string in the following format (using IPv4 addresses) - 0.0.0.0:0000

Returns the category’s configuration information in the toml::Value format. This will contain the ip/port if provided, along with any other configuration information found in the config file.

Examples
use kubos_system::Config;

let config = Config::new("example-service").unwrap();
let raw = config.raw();
let bus = raw["bus"].as_str();

Performs a get on the raw config data

Arguments

key - Key of value to get from config

  • Arguments key - Key of value to get from config

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.