XU XUv0.16.0

#container/list

import: #container/list

counts: 7 functions, 10 methods, 1 types, 0 constants, 0 method sets

Doubly linked list; values are owning strings.

struct List

XuAPI
pub struct List {
    pub val []string
    pub next []int
    pub prev []int
    pub len int
    pub free int
}

Purpose

Structure encapsulating val, next, prev, len, free.

Public fields

val []string
value
next []int
field ([]int)
prev []int
field ([]int)
len int
field (int)
free int
field (int)

($&List) init

XuAPI
pub fn (l $&List) init()

Purpose

Initialize internal state and default parameters.

Parameters

l $&List
The List instance used by this call (exclusive borrow).

Returns

This call does not return a value.

new

XuAPI
pub fn new() List

Purpose

Construct a new value of this type.

Parameters

No arguments are required.

Returns

List — a value of this type

($&List) push_back

XuAPI
pub fn (l $&List) push_back(v string) int

Purpose

Operation on $&List: push back.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
v string
value (string)

Returns

int — a value of this type

($&List) push_front

XuAPI
pub fn (l $&List) push_front(v string) int

Purpose

Operation on $&List: push front.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
v string
value (string)

Returns

int — a value of this type

($&List) insert_after

XuAPI
pub fn (l $&List) insert_after(e int, v string) int

Purpose

Operation on $&List: insert after.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
e int
e (int)
v string
value (string)

Returns

int — a value of this type

($&List) insert_before

XuAPI
pub fn (l $&List) insert_before(e int, v string) int

Purpose

Operation on $&List: insert before.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
e int
e (int)
v string
value (string)

Returns

int — a value of this type

($&List) remove

XuAPI
pub fn (l $&List) remove(e int) string

Purpose

Operation on $&List: remove.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
e int
e (int)

Returns

string — result string

($&List) move_to_front

XuAPI
pub fn (l $&List) move_to_front(e int)

Purpose

Operation on $&List: move to front.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
e int
e (int)

Returns

This call does not return a value.

($&List) move_to_back

XuAPI
pub fn (l $&List) move_to_back(e int)

Purpose

Operation on $&List: move to back.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
e int
e (int)

Returns

This call does not return a value.

($&List) move_after

XuAPI
pub fn (l $&List) move_after(e int, mark int)

Purpose

Operation on $&List: move after.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
e int
e (int)
mark int
mark (int)

Returns

This call does not return a value.

($&List) move_before

XuAPI
pub fn (l $&List) move_before(e int, mark int)

Purpose

Operation on $&List: move before.

Parameters

l $&List
The List instance used by this call (exclusive borrow).
e int
e (int)
mark int
mark (int)

Returns

This call does not return a value.

len

XuAPI
pub fn len(l &List) int

Purpose

Return the length.

Parameters

l &List
l (read-only borrow; caller keeps the original; type &List)

Returns

int — a value of this type

front

XuAPI
pub fn front(l &List) int

Purpose

Execute front.

Parameters

l &List
l (read-only borrow; caller keeps the original; type &List)

Returns

int — a value of this type

back

XuAPI
pub fn back(l &List) int

Purpose

Execute back.

Parameters

l &List
l (read-only borrow; caller keeps the original; type &List)

Returns

int — a value of this type

next

XuAPI
pub fn next(l &List, e int) int

Purpose

Take the next item, or end according to this type.

Parameters

l &List
l (read-only borrow; caller keeps the original; type &List)
e int
e (int)

Returns

int — a value of this type

prev

XuAPI
pub fn prev(l &List, e int) int

Purpose

Execute prev.

Parameters

l &List
l (read-only borrow; caller keeps the original; type &List)
e int
e (int)

Returns

int — a value of this type

value

XuAPI
pub fn value(l &List, e int) string

Purpose

Execute value.

Parameters

l &List
l (read-only borrow; caller keeps the original; type &List)
e int
e (int)

Returns

string — result string