[][src]Crate v9

A data engine for Data Oriented Design. crate:v9 is a vastly simpler version of crate:v11. Example code

Design

A Universe works like a HashMap<TypeId, Any>. A single instance of any type can be inserted into the universe. Changes can then be made by running a Kernel. A Kernel is any closure whose arguments all implement Extract. (The Extract trait works like fn extract(&Universe) -> Self.)

Encapsulation

This crate makes an unreasonable amount of things public. This is intentional! An application should encapsulate v9 behind its own interfaces.

It's hard to foresee all needs; hopefully you can do something useful with them, and this is more honest than making things pub to satisfy my whims.

Safety

┐(ツ)┌

My priorities are:

  1. A clean API.
  2. Gotta go fast:
    • Compile-times must be fast.
    • Bulk operations (mainly the kernels) must be h*ckin' fast.
  3. Safety.

If you've tripped over something, that we'd maybe wish didn't compile, and it doesn't blow up at runtime in an obvious way, then I'll be concerned. Monkey-proofing is not a high priority.

Modules

column

Columns and their extractions.

event

Mechanisms for responding to events.

extract

Extracting values from the Universe.

id

Ids, lists of Ids, and various iterators.

kernel

Running functions over the Universe.

linkage

Connecting tables.

lock

Low-level locking.

object
prelude

A tasteful set of items.

prelude_lib

An indiscriminant selection of most things.

prelude_macro

Provides a single import statement for decl_table!.

property
table
util

Macros

decl_context

Extract many things at once.

decl_property

Declares a singleton property.

decl_table

Defines a table. This is the most important item in the crate!