Trait dotfiles_core::directive::Directive
source · pub trait Directive<'a>: HasDirectiveData<'a> {
// Provided methods
fn get_setting_from_yaml_hash_or_from_context(
&'a self,
name: &str,
yaml: &StrictYaml,
context_settings: &Settings
) -> Result<Setting, DotfilesError> { ... }
fn get_setting_from_yaml_hash(
&'a self,
name: &str,
yaml: &StrictYaml
) -> Result<Setting, DotfilesError> { ... }
}
Expand description
A parser for action steps, each directive represents a type of Action.
Provided Methods§
sourcefn get_setting_from_yaml_hash_or_from_context(
&'a self,
name: &str,
yaml: &StrictYaml,
context_settings: &Settings
) -> Result<Setting, DotfilesError>
fn get_setting_from_yaml_hash_or_from_context( &'a self, name: &str, yaml: &StrictYaml, context_settings: &Settings ) -> Result<Setting, DotfilesError>
Parse a particular setting with its correct type from yaml, fall back to context settings or directive defaults if not found in yaml. Returns error if there is any kind of parsing or typing error
sourcefn get_setting_from_yaml_hash(
&'a self,
name: &str,
yaml: &StrictYaml
) -> Result<Setting, DotfilesError>
fn get_setting_from_yaml_hash( &'a self, name: &str, yaml: &StrictYaml ) -> Result<Setting, DotfilesError>
Parses an individual setting named name
from a yaml hash using the type stored in
DirectiveData.setting_types
.