Enum ProjectType

Source
#[non_exhaustive]
pub enum ProjectType {
Show 22 variants Bazaar, Darcs, Fossil, Git, Mercurial, Pijul, Subversion, Bundler, C, Cargo, Docker, Elixir, Go, Gradle, JavaScript, Leiningen, Maven, Perl, PHP, Pip, V, Zig,
}
Expand description

Project types recognised by watchexec.

There are two kinds of projects: VCS and software suite. The latter is more characterised by what package manager or build system is in use. The enum is marked non-exhaustive as more types can get added in the future.

Do not rely on the ordering or value (e.g. with transmute) of the variants.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Bazaar

VCS: Bazaar.

Detects when a .bzr folder or a .bzrignore file is present. Bazaar does not support (at writing, anyway) ignore files deeper than the repository origin, so this should not false-positive.

§

Darcs

VCS: Darcs.

Detects when a _darcs folder is present.

§

Fossil

VCS: Fossil.

Detects when a .fossil-settings folder is present.

§

Git

VCS: Git.

Detects when a .git file or folder is present, or any of the files .gitattributes or .gitmodules. Does not check or return from the presence of .gitignore files, as Git supports nested ignores, and that would result in false-positives.

§

Mercurial

VCS: Mercurial.

Detects when a .hg folder is present, or any of the files .hgignore or .hgtags. Mercurial does not support (at writing, anyway) ignore files deeper than the repository origin, so this should not false-positive.

§

Pijul

VCS: Pijul.

This is not detected at the moment.

§

Subversion

VCS: Subversion (aka SVN).

Detects when a .svn folder is present.

§

Bundler

Soft: Ruby’s Bundler.

Detects when a Gemfile file is present.

§

C

Soft: the C programming language.

Detects when a .ctags file is present.

§

Cargo

Soft: Rust’s Cargo.

Detects Cargo workspaces and Cargo crates through the presence of a Cargo.toml file.

§

Docker

Soft: the Docker container runtime.

Detects when a Dockerfile file is present.

§

Elixir

Soft: the Elixir language.

Detects when a mix.exs file is present.

§

Go

Soft: the Go language.

Detects when a go.mod or go.sum file is present.

§

Gradle

Soft: Java’s Gradle.

Detects when a build.gradle file is present.

§

JavaScript

Soft: EcmaScript (aka JavaScript).

Detects when a package.json or cgmanifest.json file is present.

This is a catch-all for all package.json-based projects, and does not differentiate between NPM, Yarn, PNPM, Node, browser, Deno, Bun, etc.

§

Leiningen

Soft: Clojure’s Leiningen.

Detects when a project.clj file is present.

§

Maven

Soft: Java’s Maven.

Detects when a pom.xml file is present.

§

Perl

Soft: the Perl language.

Detects when a .perltidyrc or Makefile.PL file is present.

§

PHP

Soft: the PHP language.

Detects when a composer.json file is present.

§

Pip

Soft: Python’s Pip.

Detects when a requirements.txt or Pipfile file is present.

§

V

Soft: the V language.

Detects when a v.mod file is present.

§

Zig

Soft: the Zig language.

Detects when a build.zig file is present.

Implementations§

Source§

impl ProjectType

Source

pub const fn is_vcs(self) -> bool

Returns true if the project type is a VCS.

Source

pub const fn is_soft(self) -> bool

Returns true if the project type is a software suite.

Trait Implementations§

Source§

impl Clone for ProjectType

Source§

fn clone(&self) -> ProjectType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProjectType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for ProjectType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ProjectType

Source§

fn eq(&self, other: &ProjectType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ProjectType

Source§

impl Eq for ProjectType

Source§

impl StructuralPartialEq for ProjectType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.