diff --git a/.gitignore b/.gitignore
index 62fe02f..1e7caa9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-target/debug
Cargo.lock
+target/
diff --git a/docs/implementors/core/cmp/trait.PartialEq.js b/docs/implementors/core/cmp/trait.PartialEq.js
new file mode 100644
index 0000000..043586b
--- /dev/null
+++ b/docs/implementors/core/cmp/trait.PartialEq.js
@@ -0,0 +1,10 @@
+(function() {var implementors = {};
+implementors["merkle"] = ["impl<T: PartialEq > PartialEq for Positioned <T>",];
+
+ if (window.register_implementors) {
+ window.register_implementors(implementors);
+ } else {
+ window.pending_implementors = implementors;
+ }
+
+})()
diff --git a/docs/implementors/merkle/trait.Hashable.js b/docs/implementors/merkle/trait.Hashable.js
deleted file mode 100644
index c3b3263..0000000
--- a/docs/implementors/merkle/trait.Hashable.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["merkle"] = [];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/docs/main.css b/docs/main.css
index aee6d15..6a9a24f 100644
--- a/docs/main.css
+++ b/docs/main.css
@@ -26,7 +26,7 @@ h1.fqn {
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #DDDDDD;
}
-.in-band, code {
+.in-band {
background-color: white;
}
@@ -34,7 +34,7 @@ div.stability > em > code {
background-color: initial;
}
-.docblock code {
+.docblock code, .docblock-short code {
background-color: #F5F5F5;
}
pre {
@@ -107,13 +107,13 @@ nav.main .current {
border-bottom-color: #000;
}
nav.main .separator {
- border-color: 1px solid #000;
+ border: 1px solid #000;
}
a {
color: #000;
}
-.docblock a, .stability a {
+.docblock a, .docblock-short a, .stability a {
color: #3873AD;
}
diff --git a/docs/main.js b/docs/main.js
index 68035e5..9bb7246 100644
--- a/docs/main.js
+++ b/docs/main.js
@@ -34,7 +34,8 @@
"primitive",
"associatedtype",
"constant",
- "associatedconstant"];
+ "associatedconstant",
+ "union"];
// used for special search precedence
var TY_PRIMITIVE = itemTypes.indexOf("primitive");
@@ -577,10 +578,6 @@
displayPath = item.path + '::';
href = rootPath + item.path.replace(/::/g, '/') + '/' +
name + '/index.html';
- } else if (type === 'static' || type === 'reexport') {
- displayPath = item.path + '::';
- href = rootPath + item.path.replace(/::/g, '/') +
- '/index.html';
} else if (type === "primitive") {
displayPath = "";
href = rootPath + item.path.replace(/::/g, '/') +
@@ -591,9 +588,14 @@
} else if (item.parent !== undefined) {
var myparent = item.parent;
var anchor = '#' + type + '.' + name;
- displayPath = item.path + '::' + myparent.name + '::';
+ var parentType = itemTypes[myparent.ty];
+ if (parentType === "primitive") {
+ displayPath = myparent.name + '::';
+ } else {
+ displayPath = item.path + '::' + myparent.name + '::';
+ }
href = rootPath + item.path.replace(/::/g, '/') +
- '/' + itemTypes[myparent.ty] +
+ '/' + parentType +
'.' + myparent.name +
'.html' + anchor;
} else {
diff --git a/docs/merkle/MerkleDigest.t.html b/docs/merkle/MerkleDigest.t.html
new file mode 100644
index 0000000..d8c8889
--- /dev/null
+++ b/docs/merkle/MerkleDigest.t.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ Redirecting to trait.MerkleDigest.html ...
+
+
+
\ No newline at end of file
diff --git a/docs/merkle/MerkleTree.t.html b/docs/merkle/MerkleTree.t.html
new file mode 100644
index 0000000..878b8fc
--- /dev/null
+++ b/docs/merkle/MerkleTree.t.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ Redirecting to struct.MerkleTree.html ...
+
+
+
\ No newline at end of file
diff --git a/docs/merkle/Positioned.t.html b/docs/merkle/Positioned.t.html
new file mode 100644
index 0000000..22306db
--- /dev/null
+++ b/docs/merkle/Positioned.t.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ Redirecting to enum.Positioned.html ...
+
+
+
\ No newline at end of file
diff --git a/docs/merkle/Proof.t.html b/docs/merkle/Proof.t.html
new file mode 100644
index 0000000..8e3d026
--- /dev/null
+++ b/docs/merkle/Proof.t.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ Redirecting to struct.Proof.html ...
+
+
+
\ No newline at end of file
diff --git a/docs/merkle/ProofBlock.t.html b/docs/merkle/ProofBlock.t.html
new file mode 100644
index 0000000..4c0cf0e
--- /dev/null
+++ b/docs/merkle/ProofBlock.t.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ Redirecting to struct.ProofBlock.html ...
+
+
+
\ No newline at end of file
diff --git a/docs/merkle/enum.Positioned.html b/docs/merkle/enum.Positioned.html
new file mode 100644
index 0000000..b710609
--- /dev/null
+++ b/docs/merkle/enum.Positioned.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+ merkle::Positioned - Rust
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+pub enum Positioned<T> {
+ Nowhere,
+ Left(T),
+ Right(T),
+} Tags a value so that we know from in branch (if any) it was found.
+
Variants
+Nowhere
Left(T)
The value was found in the left branch
+
Right(T)
The value was found in the right branch
+
Trait Implementations
+
+
This method tests for self
and other
values to be equal, and is used by ==
. Read more
+
+
This method tests for !=
.
+
+
+
+
+
+
+
+
Help
+
+
+
Keyboard Shortcuts
+
+
+ ?
+ Show this help dialog
+ S
+ Focus the search field
+ ⇤
+ Move up in search results
+ ⇥
+ Move down in search results
+ ⏎
+ Go to active search result
+ +
+ Collapse/expand all sections
+
+
+
+
+
Search Tricks
+
+
+ Prefix searches with a type followed by a colon (e.g.
+ fn:
) to restrict the search to a given type.
+
+
+
+ Accepted types are: fn
, mod
,
+ struct
, enum
,
+ trait
, type
, macro
,
+ and const
.
+
+
+
+ Search functions by type signature (e.g.
+ vec -> usize
or * -> vec
)
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/merkle/enum.Tree.html b/docs/merkle/enum.Tree.html
deleted file mode 100644
index 61669b0..0000000
--- a/docs/merkle/enum.Tree.html
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
-
-
-
-
- merkle::Tree - Rust
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pub enum Tree<T> {
- Leaf {
- hash: Vec <u8 >,
- value: T,
- },
- Node {
- hash: Vec <u8 >,
- left: Box <Tree <T>>,
- right: Box <Tree <T>>,
- },
-} Binary Tree where leaves hold a stand-alone value.
-
Variants
-Leaf
Fields
-
- Node
Fields
-
- Methods
-fn new (hash: Vec <u8 >, value: T) -> Self
-
-
Returns a hash from the tree.
-
fn make_leaf <D: Digest>(digest: &mut D, value: T) -> Tree <T>
-
-
-
-
-
-
-
-
Help
-
-
-
Keyboard Shortcuts
-
-
- ?
- Show this help dialog
- S
- Focus the search field
- ⇤
- Move up in search results
- ⇥
- Move down in search results
- ⏎
- Go to active search result
- +
- Collapse/expand all sections
-
-
-
-
-
Search Tricks
-
-
- Prefix searches with a type followed by a colon (e.g.
- fn:
) to restrict the search to a given type.
-
-
-
- Accepted types are: fn
, mod
,
- struct
, enum
,
- trait
, type
, macro
,
- and const
.
-
-
-
- Search functions by type signature (e.g.
- vec -> usize
or * -> vec
)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/merkle/hashable/trait.Hashable.html b/docs/merkle/hashable/trait.Hashable.html
deleted file mode 100644
index ed01c03..0000000
--- a/docs/merkle/hashable/trait.Hashable.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
- Redirecting to ../../merkle/trait.Hashable.html ...
-
-
-
\ No newline at end of file
diff --git a/docs/merkle/index.html b/docs/merkle/index.html
index 0ecd6f0..6c36c95 100644
--- a/docs/merkle/index.html
+++ b/docs/merkle/index.html
@@ -47,39 +47,52 @@
[− ]
- [src]
+ [src]
merkle implements a Merkle Tree in Rust.
-
-
+
MerkleTree
-
- The Merkle tree
+
+ A Merkle tree is a binary tree, with values of type T
at the leafs,
+and where every node holds the hash of the concatenation of the hashes of
+its children nodes.
+
+
+
+ Proof
+
+ An inclusion proof represent the fact that value
is a member of a MerkleTree
+with root hash root_hash
, and hash function digest
.
+A proof is a linked-list of ProofBlock
s.
+TODO: Represent a proof as a vector of ProofBlock instead of a linked-list?
+
+
+
+ ProofBlock
+
+ A ProofBlock
is a linked-list holding the hash of the node, the hash of its sibling node,
+and the rest of the inclusion proof.
- Tree
-
- Binary Tree where leaves hold a stand-alone value.
+ Positioned
+
+ Tags a value so that we know from in branch (if any) it was found.
-
- Hashable
-
- By definition, data in the Merkle Tree must implement Hashable
-
-
MerkleDigest
-
- Extends the standard crypto::digest::Digest
to play nicely with our Merkle Tree
+
+ The sole purpose of this trait is to extend the standard
+crypto::digest::Digest
with a couple utility functions.
@@ -137,11 +150,9 @@
-