[−][src]Struct xalloc::arena::pooled::PooledArena
Adds a vacant entry pool to any memory arena for faster reallocation.
Methods
impl<T, A, P> PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
pub fn new(inner: A) -> Self
[src]
Construct a PooledArena
.
pub fn with_capacity(inner: A, capacity: usize) -> Self
[src]
Construct a PooledArena
with the specified number of pre-allocated
entries.
pub fn purge(&mut self)
[src]
Discard all vacant entries.
Trait Implementations
impl<T, A, P> UnsafeArena<T> for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
type Ptr = A::Ptr
Pointer type. Read more
fn insert(&mut self, x: T) -> Self::Ptr
[src]
unsafe fn get_unchecked(&self, ptr: &Self::Ptr) -> &T
[src]
unsafe fn get_unchecked_mut(&mut self, ptr: &Self::Ptr) -> &mut T
[src]
unsafe fn remove_unchecked(&mut self, ptr: &Self::Ptr) -> T
[src]
fn reserve(&mut self, _additional: usize)
[src]
Reserves capacity for at least additional
values to be inserted in the arena.
impl<T, A, P> UnsafeArenaWithMembershipCheck<T> for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P> + UnsafeArenaWithMembershipCheck<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P> + UnsafeArenaWithMembershipCheck<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
unsafe fn contains_unchecked(&self, ptr: &Self::Ptr) -> bool
[src]
impl<T, A, P> Arena<T> for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P> + Arena<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P> + Arena<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
fn get(&self, ptr: &Self::Ptr) -> Option<&T>
[src]
fn get_mut(&mut self, ptr: &Self::Ptr) -> Option<&mut T>
[src]
fn remove(&mut self, ptr: &Self::Ptr) -> Option<T>
[src]
impl<T: Debug, A: Debug, P: Debug> Debug for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
Auto Trait Implementations
impl<T, A, P> Send for PooledArena<T, A, P> where
A: Send,
P: Send,
T: Send,
A: Send,
P: Send,
T: Send,
impl<T, A, P> Sync for PooledArena<T, A, P> where
A: Sync,
P: Sync,
T: Sync,
A: Sync,
P: Sync,
T: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,