|
|
|
|
|
by partiallattice
3564 days ago
|
|
> > What IS the idiomatic Rust way to do a cyclical directed graph? > Unfortunately, the correct idiomatic way is that you try very hard to avoid doing so. Rust is all about clear ownership, and it doesn't like circular references. > The usual solution is to put the cyclic graph code into a library, and to use pointers and about 20 lines of unsafe code. The point about C++ is important. Cyclic graphs are hard in any non-GC'ed language because it breaks the ownership story. |
|
That indicates a fundamental design flaw in the language.