cognitive_frames/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
2// the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/
3
4//! Defines data structures and functionality used to build and manipulate space-like and time-like
5//! relations between surfaces.
6//!
7//! ## Structure
8//!
9//! Frames are organized in tree-like structure with one root. Children of every branch have two
10//! orders:
11//!
12//!  - *time-like* - describing the order of use of frames in given branch
13//!  - *space-like* - describing placement order as drawn on screen
14//!
15//! ## Manipulations
16//!
17//! Basic manipulation in the tree is to *append*, *prepend* or *join* frames in spatial order.
18//! Using these manipulations added frame always becomes last in time order. To become first in
19//! time order the frame must be *pop*-ed.
20//!
21//! ## Extensions
22//!
23//! Extensions to basic functionality are implemented by traits first to clearly separate
24//! functionalities, secondly to make files shorter by breaking code to different modules.
25//!
26//!  - `searching` - gives more advance or common ways to find specified frames
27//!  - `settle` - implements common ways of adding or moving frames
28//!
29//! ## Implementation
30//!
31//! Frame tree is cyclic graph with each node optionally pointing to:
32//!
33//!  - parent
34//!  - next sibling in time order
35//!  - previous sibling in time order
36//!  - first child in time order
37//!  - last child in time order
38//!  - next sibling in space order
39//!  - previous sibling in space order
40//!  - first child in space order
41//!  - last child in space order
42//!
43//! Current implementation uses unsafe raw pointers. This make implementation faster and simpler
44//! than with other more idiomatic ways, but loses Rusts guaranties. Runtime safety is ensured by
45//! unit tests.
46
47extern crate cognitive_qualia as qualia;
48
49mod frame;
50pub use frame::{Frame, FrameSpaceIterator, FrameTimeIterator, Side, Parameters};
51pub use frame::{Geometry, Mobility, Mode};
52
53mod converting;
54pub use converting::Converting;
55
56mod packing;
57pub use packing::Packing;
58
59mod searching;
60pub use searching::Searching;
61
62mod settling;
63pub use settling::Settling;
64
65#[cfg(feature = "testing")]
66pub mod representation;