pub struct EntitySet<K>where
K: EntityRef,{ /* private fields */ }Expand description
Like cranelift_entity::EntitySet but enforces fallible allocation for all
methods that allocate.
Implementations§
Source§impl<K> EntitySet<K>where
K: EntityRef,
impl<K> EntitySet<K>where
K: EntityRef,
Sourcepub fn with_capacity(capacity: usize) -> Result<Self, OutOfMemory>
pub fn with_capacity(capacity: usize) -> Result<Self, OutOfMemory>
Creates a new empty set with the specified capacity.
Sourcepub fn ensure_capacity(&mut self, capacity: usize) -> Result<(), OutOfMemory>
pub fn ensure_capacity(&mut self, capacity: usize) -> Result<(), OutOfMemory>
Ensure that there is enough capacity to hold capacity total elements.
Sourcepub fn keys(&self) -> Keys<K> ⓘ
pub fn keys(&self) -> Keys<K> ⓘ
Iterate over all the keys up to the maximum in this set.
This will yield intermediate keys on the way up to the max key, even if they are not contained within the set.
Sourcepub fn insert(&mut self, k: K) -> Result<bool, OutOfMemory>
pub fn insert(&mut self, k: K) -> Result<bool, OutOfMemory>
Insert the element at k.
Returns true if k was not present in the set, i.e. this is a
newly-added element. Returns false otherwise.
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for EntitySet<K>
impl<K> RefUnwindSafe for EntitySet<K>where
K: RefUnwindSafe,
impl<K> Send for EntitySet<K>where
K: Send,
impl<K> Sync for EntitySet<K>where
K: Sync,
impl<K> Unpin for EntitySet<K>where
K: Unpin,
impl<K> UnwindSafe for EntitySet<K>where
K: 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