pub trait Runtime: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn languages(&self) -> &[&str];
fn file_extensions(&self) -> &[&str];
fn files(&self) -> &[&str];
fn commands(&self, packager: &str) -> &str;
fn entrypoint(&self) -> &str;
}Expand description
A language runtime, recognised by its languages, file extensions or files.
PHP: Utopia\Detector\Detection\Runtime.
Required Methods§
Sourcefn file_extensions(&self) -> &[&str]
fn file_extensions(&self) -> &[&str]
The extensions of its source files, such as ts.
PHP: getFileExtensions().
Sourcefn files(&self) -> &[&str]
fn files(&self) -> &[&str]
The file names that reveal it, such as package-lock.json.
PHP: getFiles().
Sourcefn commands(&self, packager: &str) -> &str
fn commands(&self, packager: &str) -> &str
The command that installs dependencies and builds, for packager
(npm, pnpm, yarn; anything else, or empty, as pnpm where it
matters).
PHP: getCommands(), with the packager setPackager() set.
Sourcefn entrypoint(&self) -> &str
fn entrypoint(&self) -> &str
The default entrypoint file, such as index.js.
PHP: getEntrypoint().
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".