Struct naga::arena::handle_set::HandleSet
source · pub struct HandleSet<T> {
len: usize,
members: BitSet,
as_keys: PhantomData<T>,
}
Expand description
A set of Handle<T>
values.
Fields§
§len: usize
Bound on indexes of handles stored in this set.
members: BitSet
members[i]
is true if the handle with index i
is a member.
as_keys: PhantomData<T>
This type is indexed by values of type T
.
Implementations§
source§impl<T> HandleSet<T>
impl<T> HandleSet<T>
sourcepub fn for_arena(arena: &impl ArenaType<T>) -> Self
pub fn for_arena(arena: &impl ArenaType<T>) -> Self
Return a new, empty HandleSet
, sized to hold handles from arena
.
sourcepub fn clear_for_arena(&mut self, arena: &impl ArenaType<T>)
pub fn clear_for_arena(&mut self, arena: &impl ArenaType<T>)
Remove all members from self
, and reserve space to hold handles from arena
.
sourcepub fn all_possible(&self) -> impl Iterator<Item = Handle<T>>
pub fn all_possible(&self) -> impl Iterator<Item = Handle<T>>
Return an iterator over all handles that could be made members of this set.
sourcepub fn insert(&mut self, handle: Handle<T>) -> bool
pub fn insert(&mut self, handle: Handle<T>) -> bool
Add handle
to the set.
Return true
if handle
was not already present in the set.
sourcepub fn remove(&mut self, handle: Handle<T>) -> bool
pub fn remove(&mut self, handle: Handle<T>) -> bool
Remove handle
from the set.
Returns true
if handle
was present in the set.
sourcepub fn insert_iter(&mut self, iter: impl IntoIterator<Item = Handle<T>>)
pub fn insert_iter(&mut self, iter: impl IntoIterator<Item = Handle<T>>)
Add handles from iter
to the set.
pub fn contains(&self, handle: Handle<T>) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for HandleSet<T>
impl<T> RefUnwindSafe for HandleSet<T>where
T: RefUnwindSafe,
impl<T> Send for HandleSet<T>where
T: Send,
impl<T> Sync for HandleSet<T>where
T: Sync,
impl<T> Unpin for HandleSet<T>where
T: Unpin,
impl<T> UnwindSafe for HandleSet<T>where
T: UnwindSafe,
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