pub struct LuaAxumRouter(pub Router);Expand description
Public newtype wrapping an axum::Router so it can round-trip through
the Lua VM as a mlua::AnyUserData.
Downstream binaries build a Rust-side axum::Router (typically
holding assay-engine HTTP routes), wrap it in this type, stash it in
a Lua global (or pass it positionally), and the Lua-defined
http.serve_with_extra(port, routes, extra) builtin pulls the router
back out and folds its routes into the dispatcher.
The type is intentionally a tuple-struct with a pub inner so callers
can construct one trivially: LuaAxumRouter(my_router).
Tuple Fields§
§0: RouterTrait Implementations§
Source§impl Clone for LuaAxumRouter
impl Clone for LuaAxumRouter
Source§fn clone(&self) -> LuaAxumRouter
fn clone(&self) -> LuaAxumRouter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl UserData for LuaAxumRouter
Available on crate feature server only.
impl UserData for LuaAxumRouter
Available on crate feature
server only.Source§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Adds custom fields specific to this userdata.
Source§fn add_methods<M>(methods: &mut M)where
M: UserDataMethods<Self>,
fn add_methods<M>(methods: &mut M)where
M: UserDataMethods<Self>,
Adds custom methods and operators specific to this userdata.
Source§fn register(registry: &mut UserDataRegistry<Self>)
fn register(registry: &mut UserDataRegistry<Self>)
Registers this type for use in Lua. Read more
Auto Trait Implementations§
impl Freeze for LuaAxumRouter
impl !RefUnwindSafe for LuaAxumRouter
impl Send for LuaAxumRouter
impl Sync for LuaAxumRouter
impl Unpin for LuaAxumRouter
impl UnsafeUnpin for LuaAxumRouter
impl !UnwindSafe for LuaAxumRouter
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> 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>
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 moreSource§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
Source§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.