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() -> Self
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
Source§impl Trace for LuaUserData
LuaUserData — boxed payload + optional metatable + user values.
impl Trace for LuaUserData
LuaUserData — boxed payload + optional metatable + user values.
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Concrete Rust type name for diagnostic/testC telemetry
(
Heap::type_name_count). Collector behavior must not branch on
this. The default covers container blanket impls, which are never
GC-boxed directly; concrete runtime types override it with
std::any::type_name::<Self>().fn trace(&self, m: &mut Marker)
Auto Trait Implementations§
impl !Freeze for LuaUserData
impl !RefUnwindSafe for LuaUserData
impl !Send for LuaUserData
impl !Sync for LuaUserData
impl !UnwindSafe for LuaUserData
impl Unpin for LuaUserData
impl UnsafeUnpin 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