summaryrefslogtreecommitdiffstats
path: root/src/node.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-04-04 16:30:23 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-04-04 16:30:23 +0200
commit412d3e81d757038bd5d8bb15e4f4ceba9f5acd6e (patch)
treeef7964d1e77aa70ecaadd59aeca4c75f21c1ea94 /src/node.rs
parent51d82ced3564aa2f4e49aab6fdeb814652de084a (diff)
Remove Node::id() requirement
A `Node` instance should not need to know about its id, because this would restrict us in case of IPFS, where we know the ID only _after_ adding the data to the storage. This commit thus removes the requirement `Node::id()`. The interface `DagBackend::get()` now returns the `NodeId` for the `Node` as well. This is mostly because it makes the implementation of `AsyncDag` less complicated. Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Tested-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/node.rs')
-rw-r--r--src/node.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/node.rs b/src/node.rs
index da57fb8..794c4af 100644
--- a/src/node.rs
+++ b/src/node.rs
@@ -9,8 +9,6 @@ use crate::NodeId;
/// A Node in the DAG, holding the data.
pub trait Node {
type Id: NodeId;
-
- fn id(&self) -> &Self::Id;
fn parent_ids(&self) -> Vec<Self::Id>;
}