Enum lucia_lang::objects::Value
source · pub enum Value {
Null,
Bool(bool),
Int(i64),
Float(f64),
ExtFunction(ExtFunction),
LightUserData(*mut u8),
Str(Gc<String>),
Table(Gc<RefCell<Table>>),
UserData(Gc<RefCell<UserData>>),
Closure(Gc<RefCell<Closure>>),
ExtClosure(Gc<RefCell<ExtClosure>>),
}Expand description
Enum of all lucia values.
Variants§
Null
null - A null value.
Bool(bool)
bool - A true / false value.
Int(i64)
int - A 64-bit integer.
Float(f64)
float - A 64-bit floating point number.
ExtFunction(ExtFunction)
ext_function - A Rust function pointer.
LightUserData(*mut u8)
light_user_data - A raw pointer.
Str(Gc<String>)
str - A UTF-8 string.
Table(Gc<RefCell<Table>>)
table - A table.
UserData(Gc<RefCell<UserData>>)
userdata - A UserData.
Closure(Gc<RefCell<Closure>>)
closure - A closure.
ExtClosure(Gc<RefCell<ExtClosure>>)
ext_closure - A closure defined in Rust.
Implementations§
source§impl Value
impl Value
pub fn is_ext_function(&self) -> bool
pub fn as_ext_function(&self) -> Option<ExtFunction>
source§impl Value
impl Value
pub fn is_light_userdata(&self) -> bool
pub fn as_light_userdata(&self) -> Option<*mut u8>
source§impl Value
impl Value
pub fn is_userdata(&self) -> bool
pub fn as_userdata(&self) -> Option<Ref<'_, UserData>>
pub fn as_userdata_mut(&self) -> Option<RefMut<'_, UserData>>
source§impl Value
impl Value
pub fn is_closure(&self) -> bool
pub fn as_closure(&self) -> Option<Ref<'_, Closure>>
pub fn as_closure_mut(&self) -> Option<RefMut<'_, Closure>>
source§impl Value
impl Value
pub fn is_ext_closure(&self) -> bool
pub fn as_ext_closure(&self) -> Option<Ref<'_, ExtClosure>>
pub fn as_ext_closure_mut(&self) -> Option<RefMut<'_, ExtClosure>>
Trait Implementations§
source§impl Extend<Value> for Table
impl Extend<Value> for Table
source§fn extend<T: IntoIterator<Item = Value>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Value>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl FromIterator<Value> for Table
impl FromIterator<Value> for Table
source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
impl Copy for Value
impl Eq for Value
Auto Trait Implementations§
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl !UnwindSafe for Value
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.