summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-04-04 13:25:35 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-04-04 13:25:35 +0200
commit7df14755ce8f961c623ce74732ca386c453511e0 (patch)
tree9c79926338484416409d1f409f61a6499a8e02f5 /README.md
parentfb364c1ff338e7a67d717b77d431937888d8c009 (diff)
Extend README
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'README.md')
-rw-r--r--README.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/README.md b/README.md
index ce325ad..50bad1a 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,43 @@ Async DAG library generic over Node type, Node Identifier Type and Backend
Experimental. Do not use.
+## What is this?
+
+My Problem was, that I wanted to implement a DAG on IPFS/IPLD. The Problem,
+though, is that the existing IPFS/IPLD libraries do not feature functionality to
+build a DAG easily.
+There are libraries for DAGs, but they all implemented the storage functionality
+themselves. I needed a backend that is _async_ and _generic_, so that I can use
+IPFS (or anything else that works async) in the backend. So this lib was born.
+
+This library does define a simple interface for the underlying backend:
+
+```rust
+#[async_trait]
+pub trait DagBackend<Id, N>
+ where N: Node,
+ Id: NodeId + Send
+{
+ async fn get(&self, id: Id) -> Result<Option<N>>;
+ async fn put(&mut self, node: N) -> Result<Id>;
+}
+```
+
+and that's it. The `AsyncDag` type implements the DAG data structure on top of
+that.
+
+
+## Limitations
+
+Because this library was initialized to be used with IPFS in the backend, is has
+some limitations:
+
+* It does assume that you cannot ever delete nodes. You can
+ rewrite the DAG, but this does not necessarily delete nodes.
+
+This list will be extended in the future. Do not assume it is complete!
+
+
## License
MPL-2.0