add instruction to import bincode dependency

This commit is contained in:
glyph 2022-10-02 17:28:24 +01:00
parent c42af06f02
commit 6f1536a09d
1 changed files with 6 additions and 0 deletions

View File

@ -188,6 +188,12 @@ impl Database {
You'll notice in the above code snippet that we're serialising the peer data as bincode before inserting it. The sled database we're using expects values in the form of a byte vector; bincode thus provides a neat way of storing complex datastructures (such as our `Peer` `struct`).
Add the `bincode` dependency to `Cargo.toml` and then test that everything compiles correctly:
```toml
bincode = "1.3"
```
That's enough database code for the moment. Now we can return to our Scuttlebutt-related code and complete the peer subscription flows.
### Follow / Unfollow a Peer