pub(crate) unsafe fn push_value(&self, value: Value) -> Result<()> {
        match value {
            Value::Nil => {
                ffi::lua_pushnil(self.state);
            }

            Value::Boolean(b) => {
                ffi::lua_pushboolean(self.state, if b { 1 } else { 0 });
            }

            Value::LightUserData(ud) => {
                ffi::lua_pushlightuserdata(self.state, ud.0);
            }

            Value::Integer(i) => {
                ffi::lua_pushinteger(self.state, i);
            }

            Value::Number(n) => {
                ffi::lua_pushnumber(self.state, n);
            }

            #[cfg(feature = "luau")]
            Value::Vector(x, y, z) => {
                ffi::lua_pushvector(self.state, x, y, z);
            }

            Value::String(s) => {
                self.push_ref(&s.0);
            }

            Value::Table(t) => {
                self.push_ref(&t.0);
            }

            Value::Function(f) => {
                self.push_ref(&f.0);
            }

            Value::Thread(t) => {
                self.push_ref(&t.0);
            }

            Value::UserData(ud) => {
                self.push_ref(&ud.0);
            }

            Value::Error(err) => {
                push_gc_userdata(self.state, WrappedFailure::Error(err))?;
            }
        }

        Ok(())
    }
// Uses 2 stack spaces, does not call checkstack
Uses 2 stack spaces, does not call checkstack
Uses 2 stack spaces does not call checkstack
pub(crate) unsafe fn push_value(&self, value: Value) -> Result<()> {
        match value {
            Value::Nil => {
                ffi::lua_pushnil(self.state);
            }
            Value::Boolean(b) => {
                ffi::lua_pushboolean(self.state, if b { 1 } else { 0 });
            }
            Value::LightUserData(ud) => {
                ffi::lua_pushlightuserdata(self.state, ud.0);
            }
            Value::Integer(i) => {
                ffi::lua_pushinteger(self.state, i);
            }
            Value::Number(n) => {
                ffi::lua_pushnumber(self.state, n);
            }
            #[cfg(feature = "luau")]
            Value::Vector(x, y, z) => {
                ffi::lua_pushvector(self.state, x, y, z);
            }
            Value::String(s) => {
                self.push_ref(&s.0);
            }
            Value::Table(t) => {
                self.push_ref(&t.0);
            }
            Value::Function(f) => {
                self.push_ref(&f.0);
            }
            Value::Thread(t) => {
                self.push_ref(&t.0);
            }
            Value::UserData(ud) => {
                self.push_ref(&ud.0);
            }
            Value::Error(err) => {
                push_gc_userdata(self.state, WrappedFailure::Error(err))?;
            }
        }
        Ok(())
    }
pub ( crate ) unsafe fn push_value ( & self , value : Value ) -> Result < ( ) > { match value { Value :: Nil => { ffi :: lua_pushnil ( self . state ) ; } Value :: Boolean ( b ) => { ffi :: lua_pushboolean ( self . state , if b { 1 } else { 0 } ) ; } Value :: LightUserData ( ud ) => { ffi :: lua_pushlightuserdata ( self . state , ud . 0 ) ; } Value :: Integer ( i ) => { ffi :: lua_pushinteger ( self . state , i ) ; } Value :: Number ( n ) => { ffi :: lua_pushnumber ( self . state , n ) ; } # [ cfg ( feature " " ) ] Value :: Vector ( x , y , z ) => { ffi :: lua_pushvector ( self . state , x , y , z ) ; } Value :: String ( s ) => { self . push_ref ( & s . 0 ) ; } Value :: Table ( t ) => { self . push_ref ( & t . 0 ) ; } Value :: Function ( f ) => { self . push_ref ( & f . 0 ) ; } Value :: Thread ( t ) => { self . push_ref ( & t . 0 ) ; } Value :: UserData ( ud ) => { self . push_ref ( & ud . 0 ) ; } Value :: Error ( err ) => { push_gc_userdata ( self . state , WrappedFailure :: Error ( err ) ) ? ; } } Ok ( ( ) ) }
Uses 2 stack spaces, does not call checkstack
Uses 2 stack spaces does not call checkstack
&self
value
Value
&self
value
Value