Module hdk::hash_path::path [−][src]
The generic path::Path
pattern.
As explained in the parent module documentation the path::Path
defines a tree structure.
The path is not an entire tree but simply one path from the root to the current depth of the tree.
A -> B -> C -> D
All possible paths for the above tree:
[]
[ A ]
[ A B ]
[ A B C ]
[ A D ]
Note:
- The path must always start at the root
-
path::Path
are sequential and contigious -
path::Path
may be empty -
path::Path
only track one branch
Applications can discover all links from a path to all children by constructing the known path components.
For example if an application knows [ A ]
then links to B
and D
will be discoverable.
If an application knows [ A B ]
then a link to C
will be discoverable.
Structs
Component | Each path component is arbitrary bytes to be hashed together in a predictable way when the path is hashed to create something that can be linked and discovered by all DHT participants. |
Path | A |
Constants
DELIMITER | Allows for “foo.bar.baz” to automatically move to/from [“foo”, “bar”, “baz”] components.
Technically it’s moving each string component in as bytes.
If this is a problem for you simply build the components yourself as a Vec<Vec |
NAME | “hdk.path” as utf8 bytes All paths use the same link tag and entry def id. Different pathing schemes/systems/implementations should namespace themselves by their path components rather than trying to layer different link namespaces over the same path components. Similarly there is no need to define different entry types for different pathing strategies. |