pub(crate) fn to_raw(&self, gc: &mut Memory) -> RawValue {
      match self {
         Value::Nil => RawValue::from(()),
         Value::False => RawValue::from(false),
         Value::True => RawValue::from(true),
         Value::Number(x) => RawValue::from(*x),
         Value::String(s) => RawValue::from(gc.manage(s)),
         Value::Function(f) => RawValue::from(gc.manage(&f.0)),
         Value::Struct(s) => RawValue::from(gc.manage(&s.0)),
         Value::List(l) => RawValue::from(gc.manage(&l.0)),
         Value::UserData(u) => RawValue::from(gc.manage(u)),
      }
   }
/// Converts a safe value to a raw value. Gives management rights of the value to the given GC.
Converts a safe value to a raw value. Gives management rights of the value to the given GC.
Converts a safe value to a raw value . Gives management rights of the value to the given GC .
pub(crate) fn to_raw(&self, gc: &mut Memory) -> RawValue {
      match self {
         Value::Nil => RawValue::from(()),
         Value::False => RawValue::from(false),
         Value::True => RawValue::from(true),
         Value::Number(x) => RawValue::from(*x),
         Value::String(s) => RawValue::from(gc.manage(s)),
         Value::Function(f) => RawValue::from(gc.manage(&f.0)),
         Value::Struct(s) => RawValue::from(gc.manage(&s.0)),
         Value::List(l) => RawValue::from(gc.manage(&l.0)),
         Value::UserData(u) => RawValue::from(gc.manage(u)),
      }
   }
pub ( crate ) fn to_raw ( & self , gc : & mut Memory ) -> RawValue { match self { Value :: Nil => RawValue :: from ( ( ) ) , Value :: False => RawValue :: from ( false ) , Value :: True => RawValue :: from ( true ) , Value :: Number ( x ) => RawValue :: from ( * x ) , Value :: String ( s ) => RawValue :: from ( gc . manage ( s ) ) , Value :: Function ( f ) => RawValue :: from ( gc . manage ( & f . 0 ) ) , Value :: Struct ( s ) => RawValue :: from ( gc . manage ( & s . 0 ) ) , Value :: List ( l ) => RawValue :: from ( gc . manage ( & l . 0 ) ) , Value :: UserData ( u ) => RawValue :: from ( gc . manage ( u ) ) , } }
Converts a safe value to a raw value.
Converts a safe value to a raw value .
&self
gc
&mut Memory