pub fn unload<S>(&self, modname: &S) -> Result<()>
    where
        S: AsRef<[u8]> + ?Sized,
    {
        let loaded = unsafe {
            let _sg = StackGuard::new(self.state);
            check_stack(self.state, 2)?;
            protect_lua!(self.state, 0, 1, fn(state) {
                ffi::luaL_getsubtable(state, ffi::LUA_REGISTRYINDEX, cstr!("_LOADED"));
            })?;
            Table(self.pop_ref())
        };

        let modname = self.create_string(modname)?;
        loaded.raw_remove(modname)?;
        Ok(())
    }
/// Unloads module `modname`.
///
/// Removes module from the [`package.loaded`] table which allows to load it again.
/// It does not support unloading binary Lua modules since they are internally cached and can be
/// unloaded only by closing Lua state.
///
/// [`package.loaded`]: https://www.lua.org/manual/5.4/manual.html#pdf-package.loaded
Unloads module `modname`.
Removes module from the [`package.loaded`] table which allows to load it again.
It does not support unloading binary Lua modules since they are internally cached and can be
unloaded only by closing Lua state.


Unloads module ` modname ` . Removes module from the [ ` package . loaded ` ] table which allows to load it again . It does not support unloading binary Lua modules since they are internally cached and can be unloaded only by closing Lua state .
pub fn unload<S>(&self, modname: &S) -> Result<()>
    where
        S: AsRef<[u8]> + ?Sized,
    {
        let loaded = unsafe {
            let _sg = StackGuard::new(self.state);
            check_stack(self.state, 2)?;
            protect_lua!(self.state, 0, 1, fn(state) {
                ffi::luaL_getsubtable(state, ffi::LUA_REGISTRYINDEX, cstr!("_LOADED"));
            })?;
            Table(self.pop_ref())
        };
        let modname = self.create_string(modname)?;
        loaded.raw_remove(modname)?;
        Ok(())
    }
pub fn unload < S > ( & self , modname : & S ) -> Result < ( ) > where S : AsRef < [ u8 ] > + ? Sized , { let loaded = unsafe { let _sg = StackGuard :: new ( self . state ) ; check_stack ( self . state , 2 ) ? ; protect_lua ! ( self state 0 1 fn ( state ) { ffi luaL_getsubtable ( state ffi LUA_REGISTRYINDEX cstr ( " " ) ) } ) ? ; Table ( self . pop_ref ( ) ) } ; let modname = self . create_string ( modname ) ? ; loaded . raw_remove ( modname ) ? ; Ok ( ( ) ) }
Unloads module `modname`.
Unloads module ` modname ` .
&self
modname
&S
&self
modname
&S