Struct garden::model::Configuration
source · pub struct Configuration {Show 16 fields
pub commands: Vec<MultiVariable>,
pub debug: HashMap<String, u8>,
pub environment: Vec<MultiVariable>,
pub gardens: Vec<Garden>,
pub grafts: Vec<Graft>,
pub groups: Vec<Group>,
pub path: Option<PathBuf>,
pub dirname: Option<PathBuf>,
pub root: Variable,
pub root_path: PathBuf,
pub shell: String,
pub templates: HashMap<String, Template>,
pub tree_search_path: Vec<PathBuf>,
pub trees: Vec<Tree>,
pub variables: Vec<NamedVariable>,
pub verbose: u8,
/* private fields */
}
Fields§
§commands: Vec<MultiVariable>
§debug: HashMap<String, u8>
§environment: Vec<MultiVariable>
§gardens: Vec<Garden>
§grafts: Vec<Graft>
§groups: Vec<Group>
§path: Option<PathBuf>
§dirname: Option<PathBuf>
§root: Variable
§root_path: PathBuf
§shell: String
§templates: HashMap<String, Template>
§tree_search_path: Vec<PathBuf>
§trees: Vec<Tree>
§variables: Vec<NamedVariable>
§verbose: u8
Implementations§
source§impl Configuration
impl Configuration
pub fn initialize(&mut self)
pub fn reset(&mut self)
sourcepub fn relative_pathbuf(&self, path: &str) -> PathBuf
pub fn relative_pathbuf(&self, path: &str) -> PathBuf
Return a pathbuf relative to the garden root.
sourcepub fn eval_tree_path(&mut self, path: &str) -> String
pub fn eval_tree_path(&mut self, path: &str) -> String
Evaluate and return a path string relative to the garden root.
sourcepub fn config_pathbuf(&self, path: &str) -> Option<PathBuf>
pub fn config_pathbuf(&self, path: &str) -> Option<PathBuf>
Resolve a pathbuf relative to the config directory.
sourcepub fn config_pathbuf_from_include(
&self,
include_path: &Path,
path: &str
) -> Option<PathBuf>
pub fn config_pathbuf_from_include(
&self,
include_path: &Path,
path: &str
) -> Option<PathBuf>
Resolve a pathbuf relative to specified include file or the config directory. Returns the first file found. The include file’s directory is checked first.
sourcepub fn config_path(&self, path: &str) -> String
pub fn config_path(&self, path: &str) -> String
Resolve a path string relative to the config directory.
sourcepub fn eval_config_path(&self, path: &str) -> String
pub fn eval_config_path(&self, path: &str) -> String
Evaluate and resolve a path string and relative to the config directory.
sourcepub fn eval_config_pathbuf(&self, path: &str) -> Option<PathBuf>
pub fn eval_config_pathbuf(&self, path: &str) -> Option<PathBuf>
Evaluate and resolve a pathbuf relative to the config directory.
sourcepub fn eval_config_pathbuf_from_include(
&self,
include_path: Option<&Path>,
path: &str
) -> Option<PathBuf>
pub fn eval_config_pathbuf_from_include(
&self,
include_path: Option<&Path>,
path: &str
) -> Option<PathBuf>
Evaluate and resolve a pathbuf relative to the config directory for “includes”.
sourcepub fn reset_variables(&mut self)
pub fn reset_variables(&mut self)
Reset resolved variables
pub fn get_id(&self) -> Option<ConfigId>
sourcepub fn set_parent(&mut self, id: ConfigId)
pub fn set_parent(&mut self, id: ConfigId)
Set the parent ConfigId from the Arena for this configuration.
sourcepub fn get_path(&self) -> Result<&PathBuf, GardenError>
pub fn get_path(&self) -> Result<&PathBuf, GardenError>
Get the config path if it is defined.
sourcepub fn get_path_for_display(&self) -> String
pub fn get_path_for_display(&self) -> String
Get a path string for this configuration. Returns the current directory when the configuration does not have a valid path.
sourcepub fn contains_graft(&self, name: &str) -> bool
pub fn contains_graft(&self, name: &str) -> bool
Return true if the configuration contains the named graft.
sourcepub fn get_tree(&self, name: &str) -> Option<&Tree>
pub fn get_tree(&self, name: &str) -> Option<&Tree>
Find a tree by name and return a reference if it exists.
sourcepub fn get_tree_pathbuf(&self, tree_idx: TreeIndex) -> Option<PathBuf>
pub fn get_tree_pathbuf(&self, tree_idx: TreeIndex) -> Option<PathBuf>
Return a pathbuf for the specified Tree index
Trait Implementations§
source§impl Clone for Configuration
impl Clone for Configuration
source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more