{"url":"https://takoyaking.hatenablog.com/entry/refcell_fnmut_deref","categories":["Rust"],"published":"2020-08-24 09:00:00","width":"100%","author_name":"TAKOYAKING","author_url":"https://blog.hatena.ne.jp/TAKOYAKING/","provider_url":"https://hatena.blog","title":"Rust: RefCell\u3067\u56f2\u3093\u3060FnMut\u306fDerefMut\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u306a\u3044","provider_name":"Hatena Blog","height":"190","description":"\u73fe\u8c61 f: RefCell<dyn FnMut()>> \u3068\u3057\u305f\u6642\u306b f.borrow_mut()() // \u3053\u306e\u5f62\u5f0f\u3067\u306f\u547c\u3079\u306a\u3044 \u3068\u306f\u547c\u3079\u305a\u3001 (&mut *f.borrow_mut())(); \u3068\u547c\u3070\u306a\u304f\u3066\u306f\u3044\u3051\u306a\u3044 \u8abf\u67fb rust - why DerefMut is not implemented for `std::cell::RefMut<'_, [..]>` which wraps FnMut? - Stack Overflow \u3053\u306e\u8a18\u4e8b\u306b\u3088\u308b\u3068\u4e0a\u8a18\u306ef.borrow_mut()()\u3067\u306f\u547c\u3079\u306a\u3044\u3068\u3042\u308a\u307e\u3057\u305f\u3002 Cannot borrow as mutable despite Dere\u2026","version":"1.0","blog_title":"TAKOYAKING\u2019s blog","image_url":"https://www.rust-lang.org/static/images/rust-social-wide.jpg","type":"rich","blog_url":"https://takoyaking.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakoyaking.hatenablog.com%2Fentry%2Frefcell_fnmut_deref\" title=\"Rust: RefCell\u3067\u56f2\u3093\u3060FnMut\u306fDerefMut\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u306a\u3044 - TAKOYAKING\u2019s blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}