pub struct RuntimeOpts {
pub libs: StdLib,
pub memory_limit: usize,
pub dev_mode: bool,
pub exec_timeout: Option<Duration>,
pub package_dir: Option<PathBuf>,
pub extra_package_dirs: Vec<PathBuf>,
}Expand description
Options for configuring the Lua runtime.
Fields§
§libs: StdLibLua standard libraries to load.
memory_limit: usizeLua memory limit in bytes.
dev_mode: boolDevelopment mode: reload the HTTP handler script before each call and include error details (Lua tracebacks) in error responses.
exec_timeout: Option<Duration>Execution budget per handler invocation, enforced by an
instruction-count hook (CPU-bound loops) and an outer async timeout
(slow I/O). None disables both.
package_dir: Option<PathBuf>Directory require is confined to: package.path is pinned to it.
None skips only the pinning — every package-bearing state has
package.loadlib removed and package.cpath emptied regardless, so
native modules can never load.
extra_package_dirs: Vec<PathBuf>Further require roots, tried in order after
package_dir, each under the same rules (a
dotted-identifier name, text-only chunks, no path from
package.path). Ignored without a package_dir. nitr test
puts its tests directory here, so shared helpers load in test
states and never in the states that serve requests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuntimeOpts
impl RefUnwindSafe for RuntimeOpts
impl Send for RuntimeOpts
impl Sync for RuntimeOpts
impl Unpin for RuntimeOpts
impl UnsafeUnpin for RuntimeOpts
impl UnwindSafe for RuntimeOpts
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> 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