What is Nostr?
Michael A. Murphy :system76: /
npub1jam…rq8p
2023-06-28 14:43:11
in reply to nevent1q…3aaz

Michael A. Murphy :system76: on Nostr: npub13w6fh…l479m Yes, and there are multiple ways to achieve this. Using only the ...

npub13w6fhssk27ffmh00g8lfr9p8adxcrvtf8lgu6z2j6je7ugmtqpws4l479m (npub13w6…479m) Yes, and there are multiple ways to achieve this. Using only the standard library, you can use a Rc'd RefCell, which requires a runtime borrow check on each access.

With the qcell crate, you can use Rc'd QCell/TCell/LCell, based on GhostCell, to achieve the same affect with compile-time borrow checks.

Or you could use generational indices like in the doubly-linked list example for the slotmap crate.

There's also some graph crates like petgraph.
Author Public Key
npub1jamd57lzvcv9uc4gqf4ym32nx6pexd024l4c04p9f5j3m079865qmsrq8p