#[non_exhaustive]pub struct Project {
pub dir: PathBuf,
pub format: Format,
pub files: Vec<PathBuf>,
}Expand description
A project to run: its folder, its format and the files that make it one.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dir: PathBufThe folder, absolute: where the tool runs.
format: FormatIts format.
files: Vec<PathBuf>The files that make it a project of that format (Format::files_in), absolute.
Implementations§
Source§impl Project
impl Project
Sourcepub fn variables(&self) -> Result<Vec<InputVariable>>
pub fn variables(&self) -> Result<Vec<InputVariable>>
The input variables of this Terraform module, by name, read from its files.
§Errors
unsupported for a project of another format; project_invalid for a file that isn’t
HCL or JSON as Terraform reads it, or a variable that isn’t one; io when a file can’t
be read.
Source§impl Project
impl Project
Sourcepub fn open(dir: &Path, format: Option<Format>) -> Result<Project>
pub fn open(dir: &Path, format: Option<Format>) -> Result<Project>
The project in dir, of format format when given, else the one detected
(Format::detect).
§Errors
project_invalid when dir isn’t a folder, when format is given and dir holds none
of its files, or as Format::detect refuses; io when dir can’t be read.
Sourcepub fn digest(&self) -> Result<String>
pub fn digest(&self) -> Result<String>
What the project’s files hold, as a short digest: it changes when one of them changes, is added or goes (an update reads it to know the project changed). What those files only point at (a build context, a provisioner’s script, a sub-module) isn’t read: the tool reads it again at every operation anyway. Not a security check.
§Errors
io when one of the files can’t be read.
Trait Implementations§
impl Eq for Project
impl StructuralPartialEq for Project
Auto Trait Implementations§
impl Forget for Project
impl Freeze for Project
impl Move for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.