pub struct PluginManifest {
pub id: String,
pub requested: Vec<Capability>,
pub editor_capabilities: CapabilitySet,
pub provides: Vec<PluginSeam>,
pub doc: Option<String>,
pub default_modes: Vec<String>,
}Expand description
Everything a plugin declares about itself and what it needs. Untrusted input; the trust tier is supplied separately at grant time.
Fields§
§id: StringStable, human-legible plugin id (fuzzy-finder). Keys the per-plugin
data dir (<config-home>/lattice/plugins/<name>/data/). Distinct from the
host-issued numeric crate::PluginId used for compact provenance.
requested: Vec<Capability>The OS capabilities the plugin requests (its WASI view).
editor_capabilities: CapabilitySetThe editor capabilities a plugin-declared mode requires (fragment §6).
provides: Vec<PluginSeam>The extension seam(s) this plugin’s component implements — which
spawn_* path(s) the loader drives. Empty ⇒ lifecycle-only (base
plugin world). Programmatic new defaults this empty;
disk discovery reads it from the manifest provides list.
doc: Option<String>PI.4: the plugin’s own documentation, shown by :describe-plugin. A
static, author-written string (immutable at editor runtime). The
preferred doc source is the plugin’s embedded WIT world doc-comment;
this manifest field is the fallback when a component ships no WIT docs.
default_modes: Vec<String>PM.3: the minor modes this plugin enables by DEFAULT. When non-empty the
loader auto-registers a <id>.enabled bool option (default true) that
gates them — on load (and on any change to the option) the manager
enables / disables each via the ModeEnablementRequested path. Empty ⇒
every mode the plugin contributes must be enabled explicitly (the CI.3
available-but-off default). The host learns the mode-ids ONLY from here
— the plugin owns them (mode-ownership).
OC.1a made this plural. A plugin with more than one on-by-default
mode could not express itself: org contributes org-todo-mode (org
files) and org-global-mode (the universal <C-x>o prefix), and
naming one left the other registered, correct, and permanently inert —
a chord that silently does nothing, with the enablement filter the only
place that would have explained it. The singular default_mode key is
still accepted and folds in here; a manifest may use either or both.
Implementations§
Source§impl PluginManifest
impl PluginManifest
Sourcepub fn new(
id: impl Into<String>,
requested: Vec<Capability>,
editor_capabilities: CapabilitySet,
) -> Self
pub fn new( id: impl Into<String>, requested: Vec<Capability>, editor_capabilities: CapabilitySet, ) -> Self
Construct a manifest programmatically (the host’s typed entry point).
Sourcepub fn from_toml_str(text: &str) -> Result<Self, ManifestError>
pub fn from_toml_str(text: &str) -> Result<Self, ManifestError>
Parse a manifest from its TOML text, validating every capability form.
A malformed capability / editor-capability / empty id is a typed
ManifestError, never a panic.
Trait Implementations§
Source§impl Clone for PluginManifest
impl Clone for PluginManifest
Source§fn clone(&self) -> PluginManifest
fn clone(&self) -> PluginManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginManifest
impl Debug for PluginManifest
impl Eq for PluginManifest
Source§impl PartialEq for PluginManifest
impl PartialEq for PluginManifest
impl StructuralPartialEq for PluginManifest
Auto Trait Implementations§
impl Freeze for PluginManifest
impl RefUnwindSafe for PluginManifest
impl Send for PluginManifest
impl Sync for PluginManifest
impl Unpin for PluginManifest
impl UnsafeUnpin for PluginManifest
impl UnwindSafe for PluginManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more