pub unsafe trait NodeBase: Eq + Hash {
// Required methods
fn retain(&self);
unsafe fn release(&self) -> usize;
fn load_rc(&self, order: Ordering) -> usize;
// Provided method
fn needs_drop() -> bool { ... }
}Expand description
Base traits to be satisfied by inner nodes for oxidd-manager. This does not
include the InnerNode trait.
§Safety
- The reference counter must be initialized to 2.
Self::retain()increments the counter by 1Self::release()decrements the counter by 1 with (at least)Releaseorder.Self::load_rc()loads the reference count with the specified load order.- An implementation must not modify the counter unless instructed externally
via the
retain()orrelease()methods.
Required Methods§
Sourcefn retain(&self)
fn retain(&self)
Atomically increment the reference counter (with
Relaxed order)
This method is responsible for preventing an overflow of the reference counter.
Provided Methods§
Sourcefn needs_drop() -> bool
fn needs_drop() -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.