pub struct DoubleArena<A, B> {
pub first: Arena<A>,
pub second: Arena<B>,
}Expand description
Two arenas paired together, useful for storing interrelated values.
Allocations in each arena are independent, but the two are kept together for lifetime management.
Fields§
§first: Arena<A>The first arena.
second: Arena<B>The second arena.
Implementations§
Source§impl<A, B> DoubleArena<A, B>
impl<A, B> DoubleArena<A, B>
Sourcepub fn alloc_pair(&mut self, a: A, b: B) -> (Idx<A>, Idx<B>)
pub fn alloc_pair(&mut self, a: A, b: B) -> (Idx<A>, Idx<B>)
Allocate a pair of related values atomically.
Returns (idx_a, idx_b) where idx_a.raw() == idx_b.raw() is NOT
guaranteed — the arenas may have different lengths.
Trait Implementations§
Auto Trait Implementations§
impl<A, B> Freeze for DoubleArena<A, B>
impl<A, B> RefUnwindSafe for DoubleArena<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for DoubleArena<A, B>
impl<A, B> Sync for DoubleArena<A, B>
impl<A, B> Unpin for DoubleArena<A, B>
impl<A, B> UnsafeUnpin for DoubleArena<A, B>
impl<A, B> UnwindSafe for DoubleArena<A, B>where
A: UnwindSafe,
B: 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