pub struct ExternalRootSet { /* private fields */ }Expand description
Values held alive by external Rust handles.
This is the embedding API’s GC anchor. It intentionally lives directly on
GlobalState instead of inside the Lua registry table: handle drop/unroot
must be cheap, infallible, and independent of the Lua stack protocol.
Implementations§
Source§impl ExternalRootSet
impl ExternalRootSet
pub fn insert(&mut self, value: LuaValue) -> ExternalRootKey
pub fn get(&self, key: ExternalRootKey) -> Option<&LuaValue>
pub fn replace( &mut self, key: ExternalRootKey, value: LuaValue, ) -> Option<LuaValue>
pub fn remove(&mut self, key: ExternalRootKey) -> Option<LuaValue>
pub fn iter_values(&self) -> impl Iterator<Item = &LuaValue>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn vacant_len(&self) -> usize
Trait Implementations§
Source§impl Debug for ExternalRootSet
impl Debug for ExternalRootSet
Source§impl Default for ExternalRootSet
impl Default for ExternalRootSet
Source§fn default() -> ExternalRootSet
fn default() -> ExternalRootSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExternalRootSet
impl !RefUnwindSafe for ExternalRootSet
impl !Send for ExternalRootSet
impl !Sync for ExternalRootSet
impl Unpin for ExternalRootSet
impl UnsafeUnpin for ExternalRootSet
impl !UnwindSafe for ExternalRootSet
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