pub struct Ref<T: ?Sized>(/* private fields */);Expand description
A reference-counted, immutable heap allocation.
Non-atomic by decision: a runtime instance and every value it owns belong to a single thread. Cycles are unreachable through the public API today but would leak; the cycle-collection strategy is explicitly deferred (design §10).
Debug builds maintain a thread-local count of live allocations,
exposed through debug_live_values, which backs the leak-check
exit criterion of plan 01.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Ref<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Ref<T>where
T: RefUnwindSafe + ?Sized,
impl<T> !Send for Ref<T>
impl<T> !Sync for Ref<T>
impl<T> Unpin for Ref<T>where
T: ?Sized,
impl<T> UnsafeUnpin for Ref<T>where
T: ?Sized,
impl<T> UnwindSafe for Ref<T>where
T: RefUnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more