pub struct PluginManager {
pub lua: Lua,
}Expand description
Orchestrates Zoi’s extensibility via global Lua plugins.
Plugins allow users to customize Zoi’s behavior by:
- Registering new subcommands (
zoi.register_command). - Intercepting lifecycle events (
zoi.on_post_install, etc.). - Overriding tool versions at runtime (shim resolution).
Plugins are stored in ~/.zoi/plugins/ and are verified against
a trusted_hashes.json database to prevent unauthorized execution.
Fields§
§lua: LuaThe initialized mlua Lua Virtual Machine.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Initializes a new PluginManager and sets up the global Lua API.
This injects the entire zoi.* API surface into the Lua environment,
enabling plugins to interact with the filesystem, HTTP, archives,
the UI, and the hook registry.
pub fn set_context(&self, scope: Scope) -> Result<()>
pub fn load_all(&self, yes: bool) -> Result<()>
pub fn trigger_hook(&self, hook_name: &str, arg: Option<Value>) -> Result<()>
pub fn trigger_hook_nonfatal(&self, hook_name: &str, arg: Option<Value>)
pub fn trigger_resolve_shim_version( &self, bin_name: &str, ) -> Result<Option<String>>
pub fn trigger_project_install_hook(&self) -> Result<bool>
pub fn run_command(&self, name: &str, args: Vec<String>) -> Result<bool>
pub fn list_commands(&self) -> Result<Vec<(String, String)>>
Auto Trait Implementations§
impl !RefUnwindSafe for PluginManager
impl !Send for PluginManager
impl !Sync for PluginManager
impl !UnwindSafe for PluginManager
impl Freeze for PluginManager
impl Unpin for PluginManager
impl UnsafeUnpin for PluginManager
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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 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>
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