Skip to main content

Frontend

Trait Frontend 

Source
pub trait Frontend {
    // Required methods
    fn name(&self) -> &str;
    fn detect(&self, root: &Path) -> bool;
    fn analyze(&self, root: &Path, config: &Config) -> Result<Model>;

    // Provided method
    fn noun(&self, kind: &str) -> Option<&'static str> { ... }
}
Expand description

One language’s reader. asbuilt-rust is the first.

Required Methods§

Source

fn name(&self) -> &str

The front-end’s name, which is also its asbuilt.toml table (rust reads [rust]).

Source

fn detect(&self, root: &Path) -> bool

Whether root is a code base this front-end reads, decided from marker files (Cargo.toml, package.json, …).

Source

fn analyze(&self, root: &Path, config: &Config) -> Result<Model>

Provided Methods§

Source

fn noun(&self, kind: &str) -> Option<&'static str>

The word this front-end’s language has for an element of kind (a model kind keyword), for what people read: Rust calls a container a crate and a component a module. The kinds stay the model’s; None, the default, keeps the kind’s own name.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§