Expand description
This is a memory structure with vertices and edges between them,
which we call Surging Object DiGraph (SODG), because it expects
modifications comping from a user (through Sodg::add
,
Sodg::bind
, and Sodg::put
) and then decides itself when
it’s time to delete some vertices (something similar to
“garbage collection”). For example, here is how you create a simple
graph with two vertices and an edge between them:
use sodg::Sodg;
let mut sodg = Sodg::empty();
sodg.add(0).unwrap();
sodg.add(1).unwrap();
sodg.bind(0, 1, "foo").unwrap();
Structs
This
Relay
doesn’t even try to find anything, but returns
an error. If you don’t know what relay to use, use DeadRelay::new()
.This
Relay
can be made of a lambda function. The function must
accept three arguments: v
is the ID of the vertex where an attribute
is not found, a
is the name of the attribute, b
is the optional locator
of the attribute. The function must return a new locator where the
search algorithm must continue. It can be just a name of a new attribute,
or an absolute locator with dots inside.It is a wrapper of a plain text with graph-modifying
instructions, for example:
This struct represents a Surging Object DiGraph (SODG). You add vertices
to it, bind them one to one with edges, put data into some of them,
and read data back:
Enums
It is an object-oriented representation of binary data
in hexadecimal format, which can be put into vertices of the graph.
You can create it from Rust primitives:
Traits
A relay that is used by
Sodg::find()
when it can’t find an attribute.
The finding algorithm asks the relay for the name of the attribute to use instead
of the not found one, which is provided as the a
argument to the relay. The
v
argument provided to the relay is the ID of the vertex
where the attribute a
is not found. The b
argument
is the locator of the not found attribute.Type Definitions
Instances of this type can be used in
Sodg::alert_on
method,
in order to ensure runtime consistency of data inside the graph.