Outsource the Shape trait, wquadtree, and shape types.

This commit is contained in:
Crozet Sébastien
2020-12-14 15:51:43 +01:00
parent 9bf1321f8f
commit cc6d1b9730
47 changed files with 444 additions and 3363 deletions

View File

@@ -3,6 +3,7 @@
//! See https://github.com/fitzgen/generational-arena/blob/master/src/lib.rs.
//! This has been modified to have a fully deterministic deserialization (including for the order of
//! Index attribution after a deserialization of the arena.
use buckler::partitioning::IndexedData;
use std::cmp;
use std::iter::{self, Extend, FromIterator, FusedIterator};
use std::mem;
@@ -51,6 +52,16 @@ pub struct Index {
generation: u64,
}
impl IndexedData for Index {
fn default() -> Self {
Self::from_raw_parts(crate::INVALID_USIZE, crate::INVALID_U64)
}
fn index(&self) -> usize {
self.into_raw_parts().0
}
}
impl Index {
/// Create a new `Index` from its raw parts.
///