deferred-map 0.4.0

High-performance generational arena using handle-based deferred insertion with O(1) operations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use uuid::Uuid;

/// Stable identity shared by a serialized primary map and its secondary maps.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub(crate) struct MapToken([u8; 16]);

impl MapToken {
    #[inline]
    pub(crate) fn new() -> Self {
        Self(Uuid::new_v4().into_bytes())
    }
}