蚀封装 问答列表

如何在不破坏封装的情况下返回对 RefCell 中某些内容的引用?

作者:Drew 提问时间:4/2/2015

我有一个具有内部可变性的结构。 use std::cell::RefCell; struct MutableInterior { hide_me: i32, vec: Vec<i32>, } ...

如何在不破坏封装的情况下返回对 RefCell 中某些内容的引用?

作者:Drew 提问时间:4/2/2015

我有一个具有内部可变性的结构。 use std::cell::RefCell; struct MutableInterior { hide_me: i32, vec: Vec<i32>, } ...


共2条 当前第1页