pub enum LuaObject {
Float(f32),
String(CString),
Unicode(String),
Nil,
Bool(bool),
Table(LuaTable),
}Variants§
Implementations§
Source§impl LuaObject
impl LuaObject
Sourcepub fn evaluate_as_bool(&self) -> bool
pub fn evaluate_as_bool(&self) -> bool
Evaluate the contents of this object.
For String and Table, returns false if the object is empty.
For Number returns false on 0.
For Bool returns the bool.
For Nil returns false.
pub fn as_float(&self) -> Result<f32, LuaTypeError>
pub fn into_string(self) -> Result<String, LuaTypeError>
pub fn to_string(&self) -> Result<String, LuaTypeError>
pub fn to_string_lossy(&self) -> Result<String, LuaTypeError>
pub fn as_nil(&self) -> Result<(), LuaTypeError>
pub fn as_bool(&self) -> Result<bool, LuaTypeError>
pub fn into_hashmap(self) -> Result<LuaTable, LuaTypeError>
pub fn as_hashmap(&self) -> Result<&LuaTable, LuaTypeError>
Trait Implementations§
impl Eq for LuaObject
Auto Trait Implementations§
impl Freeze for LuaObject
impl RefUnwindSafe for LuaObject
impl Send for LuaObject
impl Sync for LuaObject
impl Unpin for LuaObject
impl UnsafeUnpin for LuaObject
impl UnwindSafe for LuaObject
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more