Skip to main content

Command

Trait Command 

Source
pub trait Command {
    type Output;

    // Required method
    fn run(self, cx: &mut Context<'_>) -> Result<Self::Output, EngineError>;
}
Expand description

One request and its answer. Implemented by the protocol’s intents and queries, each in the module that holds its components.

Required Associated Types§

Required Methods§

Source

fn run(self, cx: &mut Context<'_>) -> Result<Self::Output, EngineError>

Answer against the tree the context holds. A mutation answers with a Planned result; nothing is written here.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Command for BatchIntent

Plan several intents as one. Each is planned against a staging copy of the workspace onto which the previous steps have been applied, so a rename may follow a move of the file it touches. Nothing real is written; see Apply.

Source§

impl Command for DeadQuery

Declarations nothing in the workspace refers to — no resolved token other than the declaration’s own name — with how many tokens vvv could not judge and so might be a use after all.

Source§

impl Command for DepsQuery

What a file imports and, across its language, who imports it — through re-exports both ways: an import is followed to the declaration it reaches, and a file importing one of this file’s declarations under an address a pub use offers it at is an importer.

Source§

impl Command for ExplainQuery

What is at a position: the enclosing declaration, its address and reach, and the files whose imports lead to it.

Source§

impl Command for FileQuery

One file as it is now, coloured by its language when one claims it.

Source§

impl Command for HistoryQuery

Applies that can still be undone, oldest first.

Source§

impl Command for ImpactQuery

Who would feel a change to a declaration: the modules importing it (or an address that re-exports it), then the modules importing those, outward, each module once at the depth it is first reached.

Source§

impl Command for ImportsQuery

Import statements worth a look, per file or across the tree.

Source§

impl Command for Intent

Plan any intent to the answer it will print. A caller that holds an Intent — a batch step, the picker, serve — asks once, without matching the variant.

Source§

impl Command for MoveIntent

Plan moving a file or a directory. Nothing is written; see Apply. A directory moves with everything under it; a Rust module moves with its a.rs + a/ pair either way.

Source§

impl Command for MoveSymbolIntent

Plan moving one declaration to another file of its language. Nothing is written; see Apply.

Source§

impl Command for OutlineQuery

What a file declares, in order, with where a path reaches each item and who may name it.

Source§

impl Command for Query

Structural or symbolic search across the workspace: only files spelling the query’s literal words are parsed.

Source§

impl Command for ReferencesQuery

The declarations called name and every token spelling it, judged: what rename acts on, answered without a plan.

Source§

impl Command for RenameIntent

Plan a rename. Nothing is written; see Apply.

Occurrences are gathered only from the languages in which a matching declaration exists, so a Rust foo never touches a TypeScript foo.

Source§

impl Command for Request

Source§

impl Command for RewriteIntent

Plan a rewrite. Nothing is written; see Apply.

Source§

impl Command for RewriteOf

The rewrite an intent makes of matches already found — a caller that keeps the matches (the picker, showing before and after) searches once. The intent’s selection still narrows them.

Source§

impl Command for SurfaceQuery

What a package offers to everyone: its pub declarations — a re-export never widens what it re-exports — plus every address a re-export offers them at, with how many files take them.

Source§

impl Command for UndoLast

Reverse the most recent apply, provided its files are untouched since.

Source§

impl Command for WhereQuery

Where name is declared, and the import that reaches each site from from, spelled as that language writes it.

Source§

impl<T: Mutation> Command for Apply<T>