Skip to main content

Capability

Enum Capability 

Source
pub enum Capability {
    FsRead(PathBuf),
    FsWrite(PathBuf),
    NetHttp(String),
    ProcSpawn,
    StateWrite,
    GrammarChord,
}
Expand description

An OS-level capability a plugin requests in its manifest. Distinct from CapabilitySet (editor/buffer capabilities); these gate the plugin’s WASI view (filesystem / network / process).

Wire form (manifest + [Display]): fs:read:<prefix>, fs:write:<prefix>, net:http:<host>, proc:spawn, state:write. The <prefix> may itself contain : (paths, host:port); only the first two segments are the discriminator.

Variants§

§

FsRead(PathBuf)

Read access to a host path prefix (fs:read:<prefix>).

§

FsWrite(PathBuf)

Read + write access to a host path prefix (fs:write:<prefix>).

§

NetHttp(String)

Outbound HTTP to one host-allowlist entry (net:http:<host>).

§

ProcSpawn

Permission to spawn subprocesses (proc:spawn). Bundled-only in v1 (dropped from a user-installed plugin’s grant — fragment §6).

§

StateWrite

OR.1: permission to persist bytes in the plugin’s own key/value store (state:write, the host-services store-* calls).

Its own capability rather than a corollary of fs:write, because the two answer different questions. fs:write:<prefix> is reach — which of the user’s files a plugin may alter — and a plugin that persists an index needs none of that. Folding the store into fs:write would make “remember something between restarts” require a grant over the user’s documents, which is the wrong trade in the direction that matters.

§

GrammarChord

CM.2: permission to bind an operator’s chord into the universal operator-pending grammar (gc{motion}, gcc, Visual gc).

A capability rather than a free contribution because it is the most user-visible power a plugin can take: it claims keys in the grammar every buffer shares, and a chord the user did not expect is worse than a feature they did not get. Declaring it puts the claim in plugin.toml, in the grant :plugins displays, and in the denial list when a tier withholds it.

Granted at BOTH tiers, unlike proc:spawn. The chord lands in the plugin’s own MinorMode layer rather than Builtin, it is visible in :plugins, and unload reverses it by provenance — so the blast radius is the plugin’s own modes. Withholding it from user-installed plugins would make contributing an operator a bundled-only feature, which is precisely the “adding new operators is first-class” claim (paramount #3) that the plugin API exists to honour.

Withheld is NOT a load failure: the operator still registers and stays reachable by name. A plugin never silently mis-binds (register-binding’s contract), and a refused chord is a decision rather than a broken wire.

Trait Implementations§

Source§

impl Clone for Capability

Source§

fn clone(&self) -> Capability

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Capability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Capability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Capability

Source§

impl FromStr for Capability

Source§

type Err = CapabilityParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for Capability

Source§

fn eq(&self, other: &Capability) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Capability

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more