Skip to main content

SkillProvider

Trait SkillProvider 

Source
pub trait SkillProvider: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn skills(&self) -> Vec<SkillEntry>;

    // Provided methods
    fn precedence(&self) -> SkillPrecedence { ... }
    fn body(&self, _name: &str) -> Option<String> { ... }
}
Expand description

A place skills come from.

Required Methods§

Source

fn id(&self) -> &str

Stable identifier, for logs and for a host that wants to find its own source again.

Source

fn skills(&self) -> Vec<SkillEntry>

Everything this source has, as of now.

Provided Methods§

Source

fn precedence(&self) -> SkillPrecedence

What this source does about a name another source already registered.

The engine’s own answer is that the disk wins: a project that writes its own review skill means to override the built-in one.

Source

fn body(&self, _name: &str) -> Option<String>

The full text of one of this source’s skills, when the source holds it rather than a file does. None means “read the entry’s path”, which is the right answer for any source backed by the filesystem.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§