pub trait AbsoluteCircularLinkedList<T: LinkType>: AbsoluteLinkedList<T> {
// Provided methods
fn attach_before(&mut self, base_element: T, new_element: T) { ... }
fn attach_after(&mut self, base_element: T, new_element: T) { ... }
fn attach_as_first(&mut self, element: T) { ... }
fn attach_as_last(&mut self, element: T) { ... }
fn detach(&mut self, element: T) { ... }
}Expand description
Circular doubly-linked list with absolute (direct) head/tail access.
Provides attach_before, attach_after, attach_as_first,
attach_as_last, and detach operations that maintain circular
links and update the head/tail/size automatically.
All methods have default implementations — an empty impl block
is sufficient once AbsoluteLinkedList is implemented.
Provided Methods§
Sourcefn attach_before(&mut self, base_element: T, new_element: T)
fn attach_before(&mut self, base_element: T, new_element: T)
Inserts new_element immediately before base_element.
If base_element is the current first element, the first
pointer is updated to new_element.
Sourcefn attach_after(&mut self, base_element: T, new_element: T)
fn attach_after(&mut self, base_element: T, new_element: T)
Inserts new_element immediately after base_element.
If base_element is the current last element, the last
pointer is updated to new_element.
Sourcefn attach_as_first(&mut self, element: T)
fn attach_as_first(&mut self, element: T)
Inserts element as the first element of the list.
If the list is empty, element becomes both first and last,
with its previous and next pointers pointing to itself.
Sourcefn attach_as_last(&mut self, element: T)
fn attach_as_last(&mut self, element: T)
Inserts element as the last element of the list.
If the list is empty, delegates to attach_as_first.