pub unsafe trait XorLinkedListOps: LinkOps {
// Required methods
unsafe fn next(
&self,
ptr: Self::LinkPtr,
prev: Option<Self::LinkPtr>,
) -> Option<Self::LinkPtr>;
unsafe fn prev(
&self,
ptr: Self::LinkPtr,
next: Option<Self::LinkPtr>,
) -> Option<Self::LinkPtr>;
unsafe fn set(
&mut self,
ptr: Self::LinkPtr,
prev: Option<Self::LinkPtr>,
next: Option<Self::LinkPtr>,
);
unsafe fn replace_next_or_prev(
&mut self,
ptr: Self::LinkPtr,
old: Option<Self::LinkPtr>,
new: Option<Self::LinkPtr>,
);
}
Expand description
Link operations for XorLinkedList
.
Required Methods§
sourceunsafe fn next(
&self,
ptr: Self::LinkPtr,
prev: Option<Self::LinkPtr>,
) -> Option<Self::LinkPtr>
unsafe fn next( &self, ptr: Self::LinkPtr, prev: Option<Self::LinkPtr>, ) -> Option<Self::LinkPtr>
Returns the “next” link pointer of ptr
.
§Safety
prev
must have been previously passed to the set
method, or
prev
must be equal to the new
argument previously passed to replace_next_or_prev
.
An implementation of next
must not panic.
sourceunsafe fn prev(
&self,
ptr: Self::LinkPtr,
next: Option<Self::LinkPtr>,
) -> Option<Self::LinkPtr>
unsafe fn prev( &self, ptr: Self::LinkPtr, next: Option<Self::LinkPtr>, ) -> Option<Self::LinkPtr>
Returns the “prev” link pointer of ptr
.
§Safety
next
must have been previously passed to the set
method, or
next
must be equal to the new
argument previously passed to replace_next_or_prev
.
An implementation of prev
must not panic.
sourceunsafe fn set(
&mut self,
ptr: Self::LinkPtr,
prev: Option<Self::LinkPtr>,
next: Option<Self::LinkPtr>,
)
unsafe fn set( &mut self, ptr: Self::LinkPtr, prev: Option<Self::LinkPtr>, next: Option<Self::LinkPtr>, )
Assigns the “prev” and “next” link pointers of ptr
.
§Safety
An implementation of set
must not panic.