Skip to main content

Runtime

Trait Runtime 

Source
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§

Source

fn name(&self) -> &str

The runtime’s name, such as node.

PHP: getName().

Source

fn languages(&self) -> &[&str]

The languages it runs, such as TypeScript.

PHP: getLanguages().

Source

fn file_extensions(&self) -> &[&str]

The extensions of its source files, such as ts.

PHP: getFileExtensions().

Source

fn files(&self) -> &[&str]

The file names that reveal it, such as package-lock.json.

PHP: getFiles().

Source

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.

Source

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".

Implementors§