pub trait RelativeCircularLinkedList<T: LinkType>: RelativeLinkedList<T> {
// Provided methods
fn attach_before(&mut self, head: T, base_element: T, new_element: T) { ... }
fn attach_after(&mut self, head: T, base_element: T, new_element: T) { ... }
fn attach_as_first(&mut self, head: T, element: T) { ... }
fn attach_as_last(&mut self, head: T, element: T) { ... }
fn detach(&mut self, head: T, element: T) { ... }
}Expand description
Circular doubly-linked list with head-relative positioning.
Like AbsoluteCircularLinkedList
but takes a head parameter to support multiple independent circular
lists sharing the same node storage.
All methods have default implementations — an empty impl block
is sufficient once RelativeLinkedList is implemented.
Provided Methods§
Sourcefn attach_before(&mut self, head: T, base_element: T, new_element: T)
fn attach_before(&mut self, head: T, base_element: T, new_element: T)
Inserts new_element immediately before base_element in the
list identified by head.
Sourcefn attach_after(&mut self, head: T, base_element: T, new_element: T)
fn attach_after(&mut self, head: T, base_element: T, new_element: T)
Inserts new_element immediately after base_element in the
list identified by head.
Sourcefn attach_as_first(&mut self, head: T, element: T)
fn attach_as_first(&mut self, head: T, element: T)
Inserts element as the first element of the list identified
by head.
Sourcefn attach_as_last(&mut self, head: T, element: T)
fn attach_as_last(&mut self, head: T, element: T)
Inserts element as the last element of the list identified
by head.