// Generated by Lisette bindgen
// Source: container/list (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.11

pub fn New() -> Ref<List>

/// Element is an element of a linked list.
pub struct Element {
  pub Value: Unknown,
}

/// List represents a doubly linked list.
/// The zero value for List is an empty list ready to use.
pub type List

impl Element {
  /// Next returns the next list element or nil.
  fn Next(self: Ref<Element>) -> Option<Ref<Element>>

  /// Prev returns the previous list element or nil.
  fn Prev(self: Ref<Element>) -> Option<Ref<Element>>
}

impl List {
  /// Back returns the last element of list l or nil if the list is empty.
  fn Back(self: Ref<List>) -> Option<Ref<Element>>

  /// Front returns the first element of list l or nil if the list is empty.
  fn Front(self: Ref<List>) -> Option<Ref<Element>>

  /// Init initializes or clears list l.
  fn Init(self: Ref<List>) -> Ref<List>

  /// InsertAfter inserts a new element e with value v immediately after mark and returns e.
  /// If mark is not an element of l, the list is not modified.
  /// The mark must not be nil.
  fn InsertAfter(self: Ref<List>, v: Unknown, mark: Ref<Element>) -> Option<Ref<Element>>

  /// InsertBefore inserts a new element e with value v immediately before mark and returns e.
  /// If mark is not an element of l, the list is not modified.
  /// The mark must not be nil.
  fn InsertBefore(self: Ref<List>, v: Unknown, mark: Ref<Element>) -> Option<Ref<Element>>

  /// Len returns the number of elements of list l.
  /// The complexity is O(1).
  fn Len(self: Ref<List>) -> int

  /// MoveAfter moves element e to its new position after mark.
  /// If e or mark is not an element of l, or e == mark, the list is not modified.
  /// The element and mark must not be nil.
  fn MoveAfter(self: Ref<List>, e: Ref<Element>, mark: Ref<Element>)

  /// MoveBefore moves element e to its new position before mark.
  /// If e or mark is not an element of l, or e == mark, the list is not modified.
  /// The element and mark must not be nil.
  fn MoveBefore(self: Ref<List>, e: Ref<Element>, mark: Ref<Element>)

  /// MoveToBack moves element e to the back of list l.
  /// If e is not an element of l, the list is not modified.
  /// The element must not be nil.
  fn MoveToBack(self: Ref<List>, e: Ref<Element>)

  /// MoveToFront moves element e to the front of list l.
  /// If e is not an element of l, the list is not modified.
  /// The element must not be nil.
  fn MoveToFront(self: Ref<List>, e: Ref<Element>)

  /// PushBack inserts a new element e with value v at the back of list l and returns e.
  fn PushBack(self: Ref<List>, v: Unknown) -> Ref<Element>

  /// PushBackList inserts a copy of another list at the back of list l.
  /// The lists l and other may be the same. They must not be nil.
  fn PushBackList(self: Ref<List>, other: Ref<List>)

  /// PushFront inserts a new element e with value v at the front of list l and returns e.
  fn PushFront(self: Ref<List>, v: Unknown) -> Ref<Element>

  /// PushFrontList inserts a copy of another list at the front of list l.
  /// The lists l and other may be the same. They must not be nil.
  fn PushFrontList(self: Ref<List>, other: Ref<List>)

  /// Remove removes e from l if e is an element of list l.
  /// It returns the element value e.Value.
  /// The element must not be nil.
  fn Remove(self: Ref<List>, e: Ref<Element>) -> Unknown
}
