Skip to main content

Introspectable

Trait Introspectable 

Source
pub trait Introspectable {
    // Required methods
    fn kind_label(&self) -> &'static str;
    fn identifier(&self) -> String;
    fn doc(&self) -> &str;
    fn sources(&self) -> Vec<SourceEntry<'_>>;

    // Provided method
    fn extra_sections(&self) -> Vec<HelpSection> { ... }
}
Expand description

A registered / bound / set thing, queryable from :describe-*.

Required Methods§

Source

fn kind_label(&self) -> &'static str

Kind label for the help-buffer heading: "command", "key", "option", "event", "mode", "buffer".

Source

fn identifier(&self) -> String

User-facing identifier: "ex:write", "j", "editor.line-numbers".

Source

fn doc(&self) -> &str

Multi-line documentation. May be empty (the renderer prints a (no documentation) placeholder).

Source

fn sources(&self) -> Vec<SourceEntry<'_>>

One or more provenance entries. Empty means “no recorded origin” (common for synthesised buffers / runtime values without a trace).

Provided Methods§

Source

fn extra_sections(&self) -> Vec<HelpSection>

Type-specific blocks: args list for commands, mode-grouped bindings for keys, value/type for options, payload for events, keymap chain for modes. Default empty.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§