Trait conch_runtime::RefCounted
[−]
[src]
pub trait RefCounted<T>: Sized + Clone + Deref<Target = T> + From<T> { fn get_mut(&mut self) -> Option<&mut T>; fn make_mut(&mut self) -> &mut T
where
T: Clone; }
A convenience trait to abstract over Arc
Required Methods
fn get_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the contained value if the wrapper has a single, unique, reference.
Returns None
if the Rc<T>
is not unique.
fn make_mut(&mut self) -> &mut T where
T: Clone,
T: Clone,
Make a mutable reference into the given implementation. If the implementation has more than one strong reference, or any weak references, the inner data is cloned.
This is also referred to as a copy-on-write.