Module encode

Source
Expand description

§Encode and Decode Predicates

§Encoding

§Predicate

FieldSize (bytes)Description
number_of_nodes2The number of nodes in the predicate.
nodes35 * number_of_nodesThe nodes in the predicate.
number_of_edges2The number of edges in the predicate.
edges2 * number_of_edgesThe edges in the predicate.

§Node

FieldSize (bytes)Description
edge_start2The index of the first edge in the edge list.
program_address32The address of the program.
reads1The type of state this program has access to.

§Edge

FieldSize (bytes)Description
edge2The index of the node that this edge points to.

Enums§

PredicateDecodeError
Errors that can occur when decoding a predicate.
PredicateEncodeError
Errors that can occur when encoding a predicate.

Functions§

decode_predicate
Decode a predicate from bytes.
encode_predicate
Encode a predicate into bytes.
predicate_encoded_size
The size of the encoded predicate.