pub unsafe trait RefCnt {
// Required methods
fn increase_ref(&self);
fn decrease_ref(&self) -> usize;
}Expand description
Provides methods to increase/decrease a strong reference to reference-counted mmemory block.
§Safety
The number of strong references store on the memory can only modified by Self::increase_ref() and Self::decrease_ref(). The initial value must be zero.
Required Methods§
Sourcefn increase_ref(&self)
fn increase_ref(&self)
Increments the strong reference count on the memory.
§Panics
If reference count already at usize::MAX.
Sourcefn decrease_ref(&self) -> usize
fn decrease_ref(&self) -> usize
Decrements the strong reference count on the memory and returns number of references before the decreasement.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".