You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing impl IntoLuaMulti for Either<L: IntoLuaMulti, R: IntoLuaMulti> #657
String, LuaValue (mlua::Value), and Option<i32> all implement IntoLua, so the tuple (LuaValue, String, Option<i32>) implements IntoLuaMulti. Additionally String implements IntoLuaMulti via impl<T: IntoLua> IntoLuaMulti for T
However, unfortunately Either only has impl<L: IntoLua, R: IntoLua> IntoLua for Either<L, R>, not the equivalent using IntoLuaMulti.
More unfortunately, the blanket impl IntoLuaMulti for T where T: IntoLua prevents Either from implementing both traits.
There is a IntoLuaMulti impl for Result<T, E> but it too uses T: IntoLua, E: IntoLua.
I'm not sure I can propose a concrete fix, but the current set of IntoLua/IntoLuaMulti impls makes it exceedingly to difficult to do multi-valued error returns in the style of io.open (which returns nil, string, number, with the last value being the errno/error code value)
Activity
khvzak commentedon Nov 5, 2025
If you change return type to
LuaResult<LuaMultiValue>, then any combination of values can be returned by: