#[non_exhaustive]pub enum Format {
Compose,
Vagrant,
Terraform,
}Expand description
The format of a project, which is the tool that runs it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Compose
A Compose project (docker compose): a compose.yaml or one of the names Compose reads.
Vagrant
A Vagrant project (vagrant): a Vagrantfile.
Terraform
A Terraform root module (terraform): one or more *.tf or *.tf.json files.
Implementations§
Source§impl Format
impl Format
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The format as written on the command line and in events (compose).
Sourcepub fn files_in(self, dir: &Path) -> Result<Vec<PathBuf>>
pub fn files_in(self, dir: &Path) -> Result<Vec<PathBuf>>
The files of dir that make it a project of this format, sorted; none when it isn’t one.
Compose: the first default file Compose itself would read (one only, as Compose takes).
Vagrant: the Vagrantfile. Terraform: every *.tf and *.tf.json file, and the provider
lock when there is one.
§Errors
io when dir can’t be listed.
Sourcepub fn detect(dir: &Path) -> Result<Format>
pub fn detect(dir: &Path) -> Result<Format>
The format of dir: the one whose files it holds (Format::files_in).
§Errors
project_invalid when dir holds no format’s files, or the files of several (a folder
with both a Compose file and a Vagrantfile: the caller names the one to run); io when
dir can’t be listed.
Trait Implementations§
impl Copy for Format
Source§impl<'de> Deserialize<'de> for Format
impl<'de> Deserialize<'de> for Format
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Format
Source§impl JsonSchema for Format
impl JsonSchema for Format
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for Format
impl Ord for Format
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Format
impl PartialOrd for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Forget for Format
impl Freeze for Format
impl Move for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.