pub struct LuaPluginOptions {
pub memory_mb: u32,
pub max_instructions: u64,
pub http_timeout: Duration,
pub network_allow: Vec<String>,
pub network: bool,
pub env_access: bool,
pub sober: Option<SoberHost>,
pub repo_root: Option<PathBuf>,
}Expand description
Tunable knobs for a LuaPlugin VM.
Defaults are conservative and align with Capabilities::legacy_default():
64 MB memory, 10 M instructions per hook call, 5 s HTTP timeout.
[HAZMAT] The instruction cap is best-effort under LuaJIT. LuaJIT’s tracing JIT can compile a tight integer loop into native code that bypasses debug hooks; the cap will not trip on that specific pathology until the loop calls a function or touches a table / string. In practice every real plugin does. The memory cap and HTTP timeout are not affected by JIT and remain hard limits.
Fields§
§memory_mb: u32Heap memory ceiling in megabytes. Counted by the Lua GC.
max_instructions: u64Hard cap on Lua instructions per single hook call.
Set to 0 to disable (not recommended).
http_timeout: DurationPer-request HTTP timeout.
network_allow: Vec<String>If set, restrict outbound HTTP to these hosts (suffix match).
network: boolMaster switch for outbound HTTP.
env_access: boolAllow os.getenv. Disable in hardened deployments.
sober: Option<SoberHost>Host-provided Sober bridge. Only set when the manifest grants it.
repo_root: Option<PathBuf>Repository root; used to scope the plugin’s storage table.
Implementations§
Source§impl LuaPluginOptions
impl LuaPluginOptions
Sourcepub fn from_capabilities(caps: &Capabilities) -> Self
pub fn from_capabilities(caps: &Capabilities) -> Self
Derive runtime options from a manifest capability block.
Trait Implementations§
Source§impl Clone for LuaPluginOptions
impl Clone for LuaPluginOptions
Source§fn clone(&self) -> LuaPluginOptions
fn clone(&self) -> LuaPluginOptions
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 LuaPluginOptions
impl Debug for LuaPluginOptions
Auto Trait Implementations§
impl !RefUnwindSafe for LuaPluginOptions
impl !UnwindSafe for LuaPluginOptions
impl Freeze for LuaPluginOptions
impl Send for LuaPluginOptions
impl Sync for LuaPluginOptions
impl Unpin for LuaPluginOptions
impl UnsafeUnpin for LuaPluginOptions
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,
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>
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