-
Referencing parent from child코딩Coding/★★Rust★★최신동향★및관련글 2022. 7. 6. 15:38728x90
Referencing parent from child
Hi folks,
I am trying to implement a logic similar to the screenshot, which made me rage quit from my room couple times, RC didn't work because it's a borrowed value, same for weak reference
https://preview.redd.it/bh4rcg1e5r991.png?width=736&format=png&auto=webp&s=f38f40f00fef0945b428eeffe43b1c49ee372d69
is this possible in Rust without opting to "unsafe"?
​
**edit: this talk pretty much sums up all my issues** \- [https://www.youtube.com/watch?v=aKLntZcp27M](https://www.youtube.com/watch?v=aKLntZcp27M)
Thanks for the help everyone, I decided to use some kind of shared container instead of wrestling with Rc and borrow checker, something like this fits my needs perfectly:
[https://github.com/fitzgen/generational-arena/blob/master/src/lib.rs](https://github.com/fitzgen/generational-arena/blob/master/src/lib.rs)
[https://docs.rs/generational-arena/latest/generational\_arena/](https://docs.rs/generational-arena/latest/generational_arena/)
https://www.reddit.com/r/rust/comments/vry92x/referencing_parent_from_child/?utm_source=share&utm_medium=ios_app&utm_name=iossmf반응형'코딩Coding > ★★Rust★★최신동향★및관련글' 카테고리의 다른 글
The impossible upgradability of Rust projects | chris biscardi (0) 2022.08.23 Rust Meetup Amsterdam-Fiberplain's path to full-stack (0) 2022.08.22 Rust Released Cycle Explains | LGR (0) 2022.08.19 웹어셈블리 개발자, 파이썬보다 '러스트' 선호...왜? (0) 2022.07.06 rust1.61에선 해결됨 ❤️I found a very fun Rust bug (0) 2022.06.29 Obscure Rust: reborrowing is a half-baked feature | Reddit (0) 2022.06.27 Nine Rules for Elegant Rust Library APIs (0) 2022.06.26 Rust : Turtles all the way down (0) 2022.06.19