NodeBase

Trait NodeBase 

Source
pub unsafe trait NodeBase:
    AtomicRefCounted
    + Eq
    + Hash {
    // Required method
    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::load_rc() loads the reference count with the specified load order.

Required Methods§

Source

fn load_rc(&self, order: Ordering) -> usize

Atomically load the current reference count with the given order

Provided Methods§

Source

fn needs_drop() -> bool

Whether this node type contains additional data that needs to be dropped to avoid memory leaks.

If the node only consists of Edges and types that implement Copy, an implementation may return false. This may speed up dropping a diagram a lot.

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.

Implementors§

Source§

impl<ET: Tag, const TAG_BITS: u32, const ARITY: usize> NodeBase for NodeWithLevel<'_, ET, TAG_BITS, ARITY>