Struct juju::Config
[−]
[src]
pub struct Config { /* fields omitted */ }
A HashMap representation of the charm's config.yaml, with some extra features: - See which values in the HashMap have changed since the previous hook. - For values that have changed, see what the previous value was. - Store arbitrary data for use in a later hook.
Methods
impl Config
[src]
fn new() -> Result<Self, JujuError>
Create a new Config and automatically load the previous config values if the .juju-persistent-config is present The .juju-persistent-config is also saved automatically when this struct is dropped.
fn get(self, key: &str) -> Result<Option<String>, JujuError>
Return the current value for this key
fn changed(self, key: &str) -> Result<bool, JujuError>
Return true if the current value for this key is different from the previous value.
fn previous(self, key: &str) -> Option<String>
Return previous value for this key, or None if there is no previous value.