None
EN
Persian Rug, Part 2 - Other ways to make object soups in Rust
['Persian Rug', 'Part - Other Ways To Make Object Soups In Rust', 'Edmund Smith']
Collabora Newsroom RSS Feed
struct group ; struct user { std::vector<std::shared_ptr> groups; }; struct group { std::optional<std::shared_ptr> leader; }; Rust will not allow this to happen: mutable references to data are only ever available when no other references exist, so the call to push_back on line 6, requiring mutable access, would not compile. struct User { groups: Vec < Arc <Mutex<Group>>>, } struct Group { user: Option < Arc <Mutex<User>>> }