1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! A data engine for Data Oriented Design.
//! `crate::v9` is a vastly simpler version of `crate::v11`.
//!
//! # Design
//! A `Universe` has the same shape as a `HashMap<TypeId, Any>`.
//! A single instance of any type can be inserted into the universe.
//! Changes can then be made by `run`ning a `Kernel`.
//! A `Kernel` is any closure whose arguments all implement `Extract`.
//! `Extract` indicates to the `Universe` what resources it needs,
//! and does whatever is necessary to provide itself as an argument to the kernel.
//!
//! This crate intentionally shares more fields that you might expect.
//! It's hard to foresee all needs; hopefully you can do something useful with them.

#[macro_use]
extern crate mopa;

// FIXME: Use UniquePtr, etc...?
// FIXME: Add universe.deny(TypeId) to allow constraints like "table is not sparse"

#[macro_use]
pub mod object;
pub mod extract;
pub mod kernel;
pub mod lock;
#[macro_use]
pub mod table;
pub mod column;
pub mod event;
pub mod id;
pub mod linkage;
pub mod util;

pub mod prelude {
    pub use crate::object::Universe;
    pub use crate::table::TableMarker;
}

pub mod prelude_macro {
    pub use crate::column::{Column, EditColumn, ReadColumn, WriteColumn};
    pub use crate::extract::*;
    pub use crate::id::{Check, CheckedIter, Id as IdV9, IdList, IdRange, Raw, UncheckedIdRange};
    pub use crate::linkage::ForeignKey;
    pub use crate::object::Universe;
    pub use crate::prelude_lib::Name;
    pub use crate::table::TableHeader;
    pub use std::any::TypeId;
    pub use std::fmt;
}

pub mod prelude_lib {
    pub use crate::extract::*;
    pub use crate::id::*;
    pub use crate::lock::*;
    pub use crate::object::*;
    pub use crate::prelude::*;
    pub use crate::table::{TableHeader, TableMarker};
    pub use crate::util::*;
    pub use std::any::{Any as StdAny, TypeId};
    pub use std::cmp::Ordering;
    pub use std::marker::PhantomData;
    pub use std::ops::{Deref, DerefMut, Index, IndexMut, Range as StdRange};
    pub use std::{fmt, mem, panic};
    pub type Name = &'static str;
}