pub struct Share {
pub origin: &'static str,
/* private fields */
}Expand description
A located distribution directory.
Fields§
§origin: &'static strHow it was found, for diagnostics: --share, the environment, the repository, or
the executable’s own installation.
Implementations§
Sourcepub fn locate(explicit: Option<&Path>, repo_root: &Path) -> Result<Self, Error>
pub fn locate(explicit: Option<&Path>, repo_root: &Path) -> Result<Self, Error>
Locate the share directory. In order: explicit (from --share), MAJORDOMUS_SHARE,
<repository root>/share when it holds a kinds file (this repository supervising
itself), and <directory of the executable>/../share (an installation laid out as
bin/ beside share/). A candidate that exists but holds no kinds file is skipped
only when it came from a convention; an explicit path that lacks one is an error.
Sourcepub fn skeleton_scope(&self) -> PathBuf
pub fn skeleton_scope(&self) -> PathBuf
The distribution’s default scope declaration, the file majordomus init seeds.
Sourcepub fn kinds_path(&self) -> PathBuf
pub fn kinds_path(&self) -> PathBuf
<share>/kinds.yaml.
Sourcepub fn schemas_dir(&self) -> PathBuf
pub fn schemas_dir(&self) -> PathBuf
<share>/schemas.
Sourcepub fn sections_dir(&self) -> PathBuf
pub fn sections_dir(&self) -> PathBuf
<share>/sections.
Sourcepub fn generated_schemas_dir(&self) -> PathBuf
pub fn generated_schemas_dir(&self) -> PathBuf
<share>/schemas/generated: the contracts of the generated documents, matched to a
document by the const of its schema member.
Sourcepub fn providers_dir(&self) -> PathBuf
pub fn providers_dir(&self) -> PathBuf
<share>/providers: the provider templates the tool ships, <provider>.tmpl each.
Sourcepub fn provider_templates(&self) -> Vec<String>
pub fn provider_templates(&self) -> Vec<String>
The providers the tool has a template for, by id (the file stem), sorted. A distribution without the directory has none; that is not an error, it is a distribution that ships no adapter.
Sourcepub fn providers_path(&self) -> PathBuf
pub fn providers_path(&self) -> PathBuf
<share>/providers.yaml.
Sourcepub fn providers(&self) -> Result<ProviderDeclarations, Error>
pub fn providers(&self) -> Result<ProviderDeclarations, Error>
The provider declarations the distribution ships, joined with its templates: one
ProviderDeclaration per id that has either, sorted by id. A distribution without
the file declares nothing and every template is a provider named by its file; a
file that does not parse is an error naming it, because a declaration half-read is
worse than none.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.