Creating Weak from &T?
⚓ Rust 📅 2026-02-02 👤 surdeus 👁️ 7I presume I am missing something obvious. In some methods on a struct, I want to create a weak reference to the structure. As far as I can tell, for good reasons, I need to get to an Rc, and then I can call Rc::downgrade(...) to get to a Weak. But when I try to figure out how to create an Rc, I end up seeing various Clone methods. I don't want a reference to a clone of the object. And &Self is not an Rc. What am I missing?
Thanks,
Joel
5 posts - 4 participants
🏷️ Rust_feed