pub struct Profiles {
pub path: PathBuf,
pub found_by: &'static str,
pub file: Option<YamlFile>,
pub connections: BTreeMap<String, Profile>,
pub destinations: BTreeMap<String, Profile>,
pub run: RunTarget,
/* private fields */
}Fields§
§path: PathBufWhere DRE looked for the file.
found_by: &'static strWhy that directory: --profiles-dir, DRE_PROFILES_DIR, the project directory or ~/.dre.
file: Option<YamlFile>None when the file doesn’t exist; loading problems are reported when it’s needed.
connections: BTreeMap<String, Profile>§destinations: BTreeMap<String, Profile>§run: RunTargetThe run’s target, which picks each profile’s entry (see Profiles::target_of).
Implementations§
Source§impl Profiles
impl Profiles
pub fn load( dir: &Path, found_by: &'static str, diags: &mut Diagnostics, ) -> Profiles
pub fn exists(&self) -> bool
Sourcepub fn section_key(&self, role: Role) -> &'static str
pub fn section_key(&self, role: Role) -> &'static str
The section key a role’s profiles were read from (sources for an 0.1 file).
pub fn get(&self, role: Role, name: &str) -> Option<&Profile>
Sourcepub fn declares(&self, role: Role, name: &str) -> bool
pub fn declares(&self, role: Role, name: &str) -> bool
Whether a (possibly partially broken) profile of this name is declared in its section.
Sourcepub fn is_builtin_local(&self, name: &str) -> bool
pub fn is_builtin_local(&self, name: &str) -> bool
Whether name means the built-in local destination (no local profile is defined).
Sourcepub fn line_of(&self, role: Role, name: &str) -> Option<usize>
pub fn line_of(&self, role: Role, name: &str) -> Option<usize>
Best-effort line of a profile’s name in the file.
Sourcepub fn target_of(&self, role: Role, profile: &str) -> String
pub fn target_of(&self, role: Role, profile: &str) -> String
The entry a profile uses in this run: the run’s target when --target or DRE_TARGET
chose it, else the profile’s own target:, else dev.
Sourcepub fn entry(&self, role: Role, profile: &str) -> Entry<'_>
pub fn entry(&self, role: Role, profile: &str) -> Entry<'_>
What a profile uses in this run. profile: local without a defined local profile is
the built-in local destination, for every target.
Sourcepub fn target(&self, role: Role, profile: &str) -> Option<&ProfileTarget>
pub fn target(&self, role: Role, profile: &str) -> Option<&ProfileTarget>
A profile’s settings for this run, when it has an entry that connects or delivers.
Sourcepub fn missing_entry(&self, role: Role, profile: &str) -> String
pub fn missing_entry(&self, role: Role, profile: &str) -> String
Why a used profile has no entry for this run, with the way to fix it.