pub struct HostRootTicket { /* private fields */ }Expand description
v1.3 Phase SR — opaque handle to a pinned host root.
Copy so embedder handle types (LuaFunction / LuaTable /
LuaRoot) stay Copy. Two u32 fields → 8 bytes total, fits in
a register; matches usize payload size on 64-bit and is smaller
on 32-bit.
Embedders store / copy / compare tickets but cannot mint a fake
one — fields are crate-private, the only constructor is
Vm::pin_host.
Generation overflow at u32::MAX retires the slot permanently
(the index is NOT pushed to the free list; future pin_host
allocations bypass it). At 10⁹ unpins/day per slot that’s ~4 days;
lifetime leak is bounded.
Implementations§
Source§impl HostRootTicket
impl HostRootTicket
Sourcepub fn idx(self) -> u32
pub fn idx(self) -> u32
Slot index this ticket targets. Diagnostic / facade-author use only — embedders should not rely on numerical identity.
Sourcepub fn generation(self) -> u32
pub fn generation(self) -> u32
Generation this ticket was issued at. Diagnostic only — equality against the live slot’s current generation determines validity.
Trait Implementations§
Source§impl Clone for HostRootTicket
impl Clone for HostRootTicket
Source§fn clone(&self) -> HostRootTicket
fn clone(&self) -> HostRootTicket
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HostRootTicket
Source§impl Debug for HostRootTicket
impl Debug for HostRootTicket
impl Eq for HostRootTicket
Source§impl Hash for HostRootTicket
impl Hash for HostRootTicket
Source§impl PartialEq for HostRootTicket
impl PartialEq for HostRootTicket
Source§fn eq(&self, other: &HostRootTicket) -> bool
fn eq(&self, other: &HostRootTicket) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HostRootTicket
Auto Trait Implementations§
impl Freeze for HostRootTicket
impl RefUnwindSafe for HostRootTicket
impl Send for HostRootTicket
impl Sync for HostRootTicket
impl Unpin for HostRootTicket
impl UnsafeUnpin for HostRootTicket
impl UnwindSafe for HostRootTicket
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.