pub struct LuaPlugin { /* private fields */ }Expand description
A sandboxed LuaJIT plugin instance.
Implementations§
Source§impl LuaPlugin
impl LuaPlugin
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
Load with default options (legacy-permissive caps, network OFF).
Sourcepub fn from_string(script: &str, name: &str) -> Result<Self>
pub fn from_string(script: &str, name: &str) -> Result<Self>
Load from a script string with default options.
Sourcepub fn load_with_options<P: AsRef<Path>>(
path: P,
options: LuaPluginOptions,
) -> Result<Self>
pub fn load_with_options<P: AsRef<Path>>( path: P, options: LuaPluginOptions, ) -> Result<Self>
Load with explicit options. Use when constructing from a manifest’s declared capabilities (the recommended path for production hosts).
Sourcepub fn from_string_with_options(
script: &str,
_name: &str,
options: LuaPluginOptions,
) -> Result<Self>
pub fn from_string_with_options( script: &str, _name: &str, options: LuaPluginOptions, ) -> Result<Self>
Load from a script string with explicit options.
Sourcepub fn call_event(&self, event: &Value) -> Result<Option<Value>>
pub fn call_event(&self, event: &Value) -> Result<Option<Value>>
Call plugin.on_event(event) if the plugin defines it.
Sourcepub fn call_typed_event(&self, event: &PluginEvent) -> Result<Option<Value>>
pub fn call_typed_event(&self, event: &PluginEvent) -> Result<Option<Value>>
Strongly-typed convenience for the Custom event variant.
Trait Implementations§
Source§impl IssuePlugin for LuaPlugin
impl IssuePlugin for LuaPlugin
fn on_issue_created(&mut self, issue: &Issue) -> PluginResult<()>
fn on_issue_updated(&mut self, issue: &Issue) -> PluginResult<()>
fn on_issue_deleted(&mut self, issue_id: &str) -> PluginResult<()>
Source§impl Plugin for LuaPlugin
impl Plugin for LuaPlugin
Source§fn metadata(&self) -> &PluginMetadata
fn metadata(&self) -> &PluginMetadata
Get plugin metadata
Source§fn init(&mut self, context: &PluginContext) -> PluginResult<()>
fn init(&mut self, context: &PluginContext) -> PluginResult<()>
Initialize the plugin with context
Source§fn execute_hook(
&mut self,
hook: &PluginHook,
data: &Value,
) -> PluginResult<Value>
fn execute_hook( &mut self, hook: &PluginHook, data: &Value, ) -> PluginResult<Value>
Execute a hook
Source§fn on_event(&mut self, event: &Value) -> PluginResult<Option<Value>>
fn on_event(&mut self, event: &Value) -> PluginResult<Option<Value>>
Handle a plugin event (new event system) Read more
Source§fn highlight(
&mut self,
request: &HighlightRequest,
) -> PluginResult<Option<HighlightResponse>>
fn highlight( &mut self, request: &HighlightRequest, ) -> PluginResult<Option<HighlightResponse>>
Render-time hook: provide syntax-highlighted spans for a chunk of text. Read more
Source§fn supports_hook(&self, hook: &PluginHook) -> bool
fn supports_hook(&self, hook: &PluginHook) -> bool
Check if plugin supports a specific hook
Source§impl SyncPlugin for LuaPlugin
impl SyncPlugin for LuaPlugin
fn on_sync_push(&mut self, issues: &[Issue]) -> PluginResult<()>
fn on_sync_pull(&mut self, issues: &[Issue]) -> PluginResult<()>
Auto Trait Implementations§
impl !RefUnwindSafe for LuaPlugin
impl !UnwindSafe for LuaPlugin
impl Freeze for LuaPlugin
impl Send for LuaPlugin
impl Sync for LuaPlugin
impl Unpin for LuaPlugin
impl UnsafeUnpin for LuaPlugin
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