summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2021-08-17 15:34:34 +0100
committerAlex Orlenko <zxteam@protonmail.com>2021-08-17 15:34:34 +0100
commit60fd060d470f63d18866c524142b252b0d8aa2d8 (patch)
tree0a70f91b9b55564acf7f3d7c888c3d61dea16c7e
parent9f02a9ca09f90082a9e0f8f2c52a331967db76a5 (diff)
downloadmlua-60fd060d470f63d18866c524142b252b0d8aa2d8.zip
Clarify about calling `Lua::init_from_ptr()` multiple times
-rw-r--r--src/lua.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lua.rs b/src/lua.rs
index 6608a4b..b799161 100644
--- a/src/lua.rs
+++ b/src/lua.rs
@@ -381,6 +381,9 @@ impl Lua {
}
/// Constructs a new Lua instance from an existing raw state.
+ ///
+ /// Once called, a returned Lua state is cached in the registry and can be retrieved
+ /// by calling this function again.
#[allow(clippy::missing_safety_doc)]
pub unsafe fn init_from_ptr(state: *mut ffi::lua_State) -> Lua {
let maybe_main_state = get_main_state(state);