2 unstable releases

Uses old Rust 2015

0.1.0 Jun 10, 2017
0.0.1 May 31, 2017

#613 in Science


Used in cognitive-exhibitor

MPL-2.0 license

180KB
3.5K SLoC

Defines data structures and functionality used to build and manipulate space-like and time-like relations between surfaces.

Structure

Frames are organized in tree-like structure with one root. Children of every branch have two orders:

  • time-like - describing the order of use of frames in given branch
  • space-like - describing placement order as drawn on screen

Manipulations

Basic manipulation in the tree is to append, prepend or join frames in spatial order. Using these manipulations added frame always becomes last in time order. To become first in time order the frame must be pop-ed.

Extensions

Extensions to basic functionality are implemented by traits first to clearly separate functionalities, secondly to make files shorter by breaking code to different modules.

  • searching - gives more advance or common ways to find specified frames
  • settle - implements common ways of adding or moving frames

Implementation

Frame tree is cyclic graph with each node optionally pointing to:

  • parent
  • next sibling in time order
  • previous sibling in time order
  • first child in time order
  • last child in time order
  • next sibling in space order
  • previous sibling in space order
  • first child in space order
  • last child in space order

Current implementation uses unsafe raw pointers. This make implementation faster and simpler than with other more idiomatic ways, but loses Rusts guaranties. Runtime safety is ensured by unit tests.

Dependencies

~7–13MB
~178K SLoC