pub unsafe trait LinkOps {
    type LinkPtr: Copy + Eq;

    // Required methods
    unsafe fn acquire_link(&mut self, ptr: Self::LinkPtr) -> bool;
    unsafe fn release_link(&mut self, ptr: Self::LinkPtr);
}
Expand description

Base trait for link operations.

LinkPtr is the representation of a link pointer. Typically this is NonNull, but compact representations such as u8 or u16 are possible.

Required Associated Types§

source

type LinkPtr: Copy + Eq

The link pointer type.

Required Methods§

Attempts to acquire ownership of a link so that it can be used in an intrusive collection.

If this function succeeds then the intrusive collection will have exclusive access to the link until release_link is called.

Releases ownership of a link that was previously acquired with acquire_link.

Safety

An implementation of release_link must not panic.

Implementors§

source§

impl LinkOps for intrusive_collections::linked_list::AtomicLinkOps

source§

impl LinkOps for intrusive_collections::linked_list::LinkOps

source§

impl LinkOps for intrusive_collections::rbtree::AtomicLinkOps

source§

impl LinkOps for intrusive_collections::rbtree::LinkOps

source§

impl LinkOps for intrusive_collections::singly_linked_list::AtomicLinkOps

source§

impl LinkOps for intrusive_collections::singly_linked_list::LinkOps

source§

impl LinkOps for intrusive_collections::xor_linked_list::AtomicLinkOps

source§

impl LinkOps for intrusive_collections::xor_linked_list::LinkOps