Crate v11[][src]

A column-based in-memory database for Data-Oriented Design.

Safety

This crate lies about safety. Rust wants to be monkey-safe; v11 aims for merely derp-safe.

The danger zones are easy to avoid:

  • Calling register() functions on domains, properties and tables. This should only be done from the main thread, before any Universes have been created.
  • Doing strange things with the references in a table lock. (Namely, mem::swap.)
  • Using pub items that are marked #[doc(hidden)]. These should only be used by macro-generated code.

Re-exports

pub extern crate serde;
pub extern crate erased_serde;

Modules

any_slice

&[T]s can't be converted to &Any, because it wants to cast [T], which is impossible because [T] is unsized. And casting &&[T] is also impossible because Any: 'static.

columns

Table indexing is strongly typed. Each table has its own index type (GenericRowId), which may be converted to an 'already checked' form (CheckedRowId).

context

Ergonomics for juggling multiple locks.

domain

Each property name is in the form "domain/property_name". A domain is a simple namespacing scheme; universes can pick and choose which domains they contain. Before being added to a universe, the domain must be registered using DOMAIN.register(). Domains are created using the domain! macro.

event

An arbitrary collection of verbs for you to use for table events. The precise meaning of the names of the events is user-defined.

examples

Run cargo doc --features doc --open to get documentation on example macro output.

index

GenericRowId, CheckedRowId, and RowRange.

joincore
map_index

Columns can be made searchable using #[index]. Such columns have their mutability restricted. The index can be searched using table.column.find(&element).

property
storage

Data structures for storing columnar elements.

table_macro
tables
tracking

Macros

context

Creates a struct that holds many table locks that implement Lockable. This is useful for ergonomically passing multiple locks to other functions. It is possible to 'transfer' one context into another using NewContext::from(universe, oldContext). Any unused locks will be dropped, and any new locks will be acquired.

domain

Declares a domain. This is similar to a single-level namespace.

property

Generates a property, which is a singleton value accessed via the Universe.

table

This macro generates a column-based data table. (It is currently implemented using the procedural-masquerade hack.)

Structs

Universe

A context object whose reference should be passed around everywhere.

Enums

Action

Return value for function parameters passed into $table.visit.

Traits

Storable

Trait describing bounds that all storable types must satisfy.

Type Definitions

GuardedUniverse