3 ms·
> Safe Rust cannot represent circular data structures which makes entire classes of algorithms and architectures unimplementable. That's not accurate. Safe Ru
by pkolaczk 3y ago
> Safe Rust cannot represent circular data structures which makes entire classes of algorithms and architectures unimplementable.
That's not accurate.
Safe Rust can represent circular data structures. It cannot represent circular data structures with 0 overhead.
But you can use Rc/Arc/Weak + RefCell for that and it is not very hard. Or use one of crates that expose ways of building self-referential structures in a safe way (of course they do use unsafe underneath, but the API is safe) like ouroboros.