pub struct LuaUserData {
pub data: Box<[u8]>,
pub uv: RefCell<Vec<LuaValue>>,
pub metatable: RefCell<Option<GcRef<LuaTable>>>,
pub host_value: RefCell<Option<Rc<dyn Any>>>,
}Fields§
§data: Box<[u8]>§uv: RefCell<Vec<LuaValue>>§metatable: RefCell<Option<GcRef<LuaTable>>>§host_value: RefCell<Option<Rc<dyn Any>>>Implementations§
Source§impl LuaUserData
impl LuaUserData
pub fn placeholder() -> LuaUserData
pub fn metatable(&self) -> Option<GcRef<LuaTable>>
pub fn set_metatable(&self, mt: Option<GcRef<LuaTable>>)
pub fn host_value(&self) -> Option<Rc<dyn Any>>
pub fn set_host_value(&self, value: Option<Rc<dyn Any>>)
Sourcepub fn buffer_bytes(&self) -> usize
pub fn buffer_bytes(&self) -> usize
Bytes owned outside the GcBox header/object allocation.
C stores full-userdata payload and user values inline in the userdata
allocation. The Rust port owns them through Box<[u8]> and Vec, so
the VM charges them explicitly against the GC heap.
Trait Implementations§
Source§impl Debug for LuaUserData
impl Debug for LuaUserData
Auto Trait Implementations§
impl !Freeze for LuaUserData
impl !RefUnwindSafe for LuaUserData
impl !Send for LuaUserData
impl !Sync for LuaUserData
impl Unpin for LuaUserData
impl UnsafeUnpin for LuaUserData
impl !UnwindSafe for LuaUserData
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