pub struct WeakHashList<T: ?Sized + 'static> { /* private fields */ }Expand description
A list of weakly referenced items, compared by identity.
Up to DEFAULT_ARRAY_SIZE items are kept in
an array; beyond that the list switches to a dictionary that counts how
many times each item was added.
Implementations§
Source§impl<T: ?Sized + 'static> WeakHashList<T>
impl<T: ?Sized + 'static> WeakHashList<T>
pub const DEFAULT_ARRAY_SIZE: usize = 8
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn need_compact(&self) -> bool
pub fn add(&mut self, item: &Rc<T>)
pub fn remove(&mut self, item: &Rc<T>)
pub fn compact(&mut self)
Clears list and keeps it for a later get_alive.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for WeakHashList<T>
impl<T> !RefUnwindSafe for WeakHashList<T>
impl<T> !Send for WeakHashList<T>
impl<T> !Sync for WeakHashList<T>
impl<T> !UnwindSafe for WeakHashList<T>
impl<T> Unpin for WeakHashList<T>
impl<T> UnsafeUnpin for WeakHashList<T>
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more