pub struct ServerlessRunner {
functions: Vec<LuaRuntime>,
plugin_type: &'static str,
}Expand description
Shared engine behind both serverless nodes: a compiled list of Lua functions run in order against the Context.
Each entry is a fully validated LuaRuntime (compiled at config load, so
bad Lua fails policy compilation, not a live request). At request time the
Context is threaded through every function: the table returned by one
function’s execute becomes the input to the next. If any function errors,
that error is propagated (routing the Context through the node’s error
port); otherwise the final Context flows through the success port.
Fields§
§functions: Vec<LuaRuntime>§plugin_type: &'static strImplementations§
Source§impl ServerlessRunner
impl ServerlessRunner
Sourcepub fn from_config(
config: &HashMap<String, Value>,
plugin_type: &'static str,
) -> Result<Self, String>
pub fn from_config( config: &HashMap<String, Value>, plugin_type: &'static str, ) -> Result<Self, String>
Builds the runner from node config, compiling every function up front.
Accepted keys:
functions(array of strings, required, ≥1): each string is Lua source defining a globalexecute(ctx)function. Each is compiled and validated here; an empty array, a non-string entry, a Lua syntax error, or a missingexecuteall fail at config load.phase(string, optional): accepted for APISIX compatibility but inert — placement in the graph determines phase.timeout_ms(integer, default5000): per-function execution timeout passed to the Lua runtime (stored, not yet enforced by the VM).
Auto Trait Implementations§
impl Freeze for ServerlessRunner
impl RefUnwindSafe for ServerlessRunner
impl Send for ServerlessRunner
impl Sync for ServerlessRunner
impl Unpin for ServerlessRunner
impl UnsafeUnpin for ServerlessRunner
impl UnwindSafe for ServerlessRunner
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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