pub trait CustomAction: Send + Sync {
// Required method
fn label(&self) -> String;
// Provided methods
fn key(&self) -> Option<String> { ... }
fn applies(&self, kind: &str, value: &str) -> bool { ... }
fn run(
&self,
kind: &str,
value: &str,
) -> Result<Option<String>, PluginError> { ... }
}Expand description
A custom action on interactive views (#491): list items, table rows, tree
nodes and file entries. A host shows it in a view’s action menu, and on
its key if it has one; when the user picks it, the view reports the
action’s name and target, and the host may call run.
Required Methods§
Provided Methods§
Sourcefn key(&self) -> Option<String>
fn key(&self) -> Option<String>
A key that picks it directly, as a key name (ctrl+o, f5), or
None (the default): from the menu only.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".