Documentation ¶
Index ¶
- func Print(format String, params ...any)
- func Println(format String, params ...any)
- type Add
- type AddAssign
- type Any
- type BTreeMap
- func (self *BTreeMap[K, V]) Clear()
- func (self *BTreeMap[K, V]) ContainsKey(key K) Bool
- func (self BTreeMap[K, V]) Debug() String
- func (self BTreeMap[K, V]) Display() String
- func (self *BTreeMap[K, V]) Get(key K) Option[V]
- func (self *BTreeMap[K, V]) Insert(key K, value V) Option[V]
- func (self BTreeMap[K, V]) IntoIter() Iterator[Pair[K, V]]
- func (self *BTreeMap[K, V]) IsEmpty() Bool
- func (self BTreeMap[K, V]) Keys() Iterator[K]
- func (self *BTreeMap[K, V]) Len() USize
- func (self *BTreeMap[K, V]) Remove(key K) Option[V]
- func (self BTreeMap[K, V]) Values() Iterator[V]
- type BTreeMapIter
- func (self BTreeMapIter[K, V]) CollectToLinkedList() LinkedList[Pair[K, V]]
- func (self BTreeMapIter[K, V]) CollectToVec() Vec[Pair[K, V]]
- func (self *BTreeMapIter[K, V]) Filter(f func(Pair[K, V]) Bool) Iterator[Pair[K, V]]
- func (self *BTreeMapIter[K, V]) Fold(init Pair[K, V], f func(Pair[K, V], Pair[K, V]) Pair[K, V]) Pair[K, V]
- func (self *BTreeMapIter[K, V]) Map(f func(Pair[K, V]) Pair[K, V]) Iterator[Pair[K, V]]
- func (self *BTreeMapIter[K, V]) Next() Option[Pair[K, V]]
- func (self BTreeMapIter[K, V]) Rev() Iterator[Pair[K, V]]
- type BTreeMapKeys
- func (self BTreeMapKeys[K]) CollectToLinkedList() LinkedList[K]
- func (self BTreeMapKeys[K]) CollectToVec() Vec[K]
- func (self *BTreeMapKeys[K]) Filter(f func(K) Bool) Iterator[K]
- func (self *BTreeMapKeys[K]) Fold(init K, f func(K, K) K) K
- func (self *BTreeMapKeys[K]) Map(f func(K) K) Iterator[K]
- func (self *BTreeMapKeys[K]) Next() Option[K]
- func (self BTreeMapKeys[K]) Rev() Iterator[K]
- type BTreeMapValues
- func (self BTreeMapValues[V]) CollectToLinkedList() LinkedList[V]
- func (self BTreeMapValues[V]) CollectToVec() Vec[V]
- func (self *BTreeMapValues[V]) Filter(f func(V) Bool) Iterator[V]
- func (self *BTreeMapValues[V]) Fold(init V, f func(V, V) V) V
- func (self *BTreeMapValues[V]) Map(f func(V) V) Iterator[V]
- func (self *BTreeMapValues[V]) Next() Option[V]
- func (self BTreeMapValues[V]) Rev() Iterator[V]
- type BTreeNode
- type BTreeSet
- func (self *BTreeSet[K]) Clear()
- func (self *BTreeSet[K]) Contains(key K) Bool
- func (self BTreeSet[K]) Debug() String
- func (self BTreeSet[K]) Display() String
- func (self *BTreeSet[K]) Insert(key K) Bool
- func (self *BTreeSet[K]) IntoIter() Iterator[K]
- func (self *BTreeSet[K]) IsEmpty() Bool
- func (self *BTreeSet[K]) Len() USize
- func (self *BTreeSet[K]) Remove(key K) Bool
- type BTreeSetIter
- func (self BTreeSetIter[K]) CollectToLinkedList() LinkedList[K]
- func (self BTreeSetIter[K]) CollectToVec() Vec[K]
- func (self BTreeSetIter[K]) Filter(f func(K) Bool) Iterator[K]
- func (self BTreeSetIter[K]) Fold(init K, f func(K, K) K) K
- func (self BTreeSetIter[K]) Map(f func(K) K) Iterator[K]
- func (self *BTreeSetIter[K]) Next() Option[K]
- func (self BTreeSetIter[K]) Rev() Iterator[K]
- type Bool
- type Byte
- func (self Byte) Add(rhs Byte) Byte
- func (self *Byte) AddAssign(rhs Byte)
- func (self Byte) Clone() Byte
- func (self Byte) Cmp(rhs Byte) Ordering
- func (self Byte) Debug() String
- func (self Byte) Display() String
- func (self Byte) Div(rhs Byte) Byte
- func (self *Byte) DivAssign(rhs Byte)
- func (self Byte) Eq(rhs Byte) Bool
- func (self Byte) Mul(rhs Byte) Byte
- func (self *Byte) MulAssign(rhs Byte)
- func (self Byte) Sub(rhs Byte) Byte
- func (self *Byte) SubAssign(rhs Byte)
- func (self Byte) ToString() String
- type Char
- func (self Char) Add(rhs Char) Char
- func (self *Char) AddAssign(rhs Char)
- func (self Char) Clone() Char
- func (self Char) Cmp(rhs Char) Ordering
- func (self Char) Debug() String
- func (self Char) Display() String
- func (self Char) Div(rhs Char) Char
- func (self *Char) DivAssign(rhs Char)
- func (self Char) Eq(rhs Char) Bool
- func (self Char) Mul(rhs Char) Char
- func (self *Char) MulAssign(rhs Char)
- func (self Char) Sub(rhs Char) Char
- func (self *Char) SubAssign(rhs Char)
- func (self Char) ToString() String
- type Clone
- type Complex128
- func (self Complex128) Add(rhs Complex128) Complex128
- func (self *Complex128) AddAssign(rhs Complex128)
- func (self Complex128) Clone() Complex128
- func (self Complex128) Debug() String
- func (self Complex128) Display() String
- func (self Complex128) Div(rhs Complex128) Complex128
- func (self *Complex128) DivAssign(rhs Complex128)
- func (self Complex128) Mul(rhs Complex128) Complex128
- func (self *Complex128) MulAssign(rhs Complex128)
- func (self Complex128) Sub(rhs Complex128) Complex128
- func (self *Complex128) SubAssign(rhs Complex128)
- func (self Complex128) ToString() String
- type Complex64
- func (self Complex64) Add(rhs Complex64) Complex64
- func (self *Complex64) AddAssign(rhs Complex64)
- func (self Complex64) Clone() Complex64
- func (self Complex64) Debug() String
- func (self Complex64) Display() String
- func (self Complex64) Div(rhs Complex64) Complex64
- func (self *Complex64) DivAssign(rhs Complex64)
- func (self Complex64) Mul(rhs Complex64) Complex64
- func (self *Complex64) MulAssign(rhs Complex64)
- func (self Complex64) Sub(rhs Complex64) Complex64
- func (self *Complex64) SubAssign(rhs Complex64)
- func (self Complex64) ToString() String
- type Debug
- type Default
- type DirEntry
- type Display
- type Div
- type DivAssign
- type Eq
- type Error
- type F32
- func (self F32) Add(rhs F32) F32
- func (self *F32) AddAssign(rhs F32)
- func (self F32) Clone() F32
- func (self F32) Cmp(rhs F32) Ordering
- func (self F32) Debug() String
- func (self F32) Display() String
- func (self F32) Div(rhs F32) F32
- func (self *F32) DivAssign(rhs F32)
- func (self F32) Eq(rhs F32) Bool
- func (self F32) Mul(rhs F32) F32
- func (self *F32) MulAssign(rhs F32)
- func (self F32) Sub(rhs F32) F32
- func (self *F32) SubAssign(rhs F32)
- func (self F32) ToString() String
- type F64
- func (self F64) Add(rhs F64) F64
- func (self *F64) AddAssign(rhs F64)
- func (self F64) Clone() F64
- func (self F64) Cmp(rhs F64) Ordering
- func (self F64) Debug() String
- func (self F64) Display() String
- func (self F64) Div(rhs F64) F64
- func (self *F64) DivAssign(rhs F64)
- func (self F64) Eq(rhs F64) Bool
- func (self F64) Mul(rhs F64) F64
- func (self *F64) MulAssign(rhs F64)
- func (self F64) Sub(rhs F64) F64
- func (self *F64) SubAssign(rhs F64)
- func (self F64) ToString() String
- type FileType
- type HashMap
- func (self HashMap[K, V]) AsMap() map[K]V
- func (self *HashMap[K, V]) Clear()
- func (self HashMap[K, V]) ContainsKey(key K) Bool
- func (self HashMap[K, V]) Debug() String
- func (self HashMap[K, V]) Display() String
- func (self HashMap[K, V]) Get(key K) Option[V]
- func (self *HashMap[K, V]) Insert(key K, value V) Option[V]
- func (self HashMap[K, V]) IntoIter() Iterator[Pair[K, V]]
- func (self HashMap[K, V]) IsEmpty() Bool
- func (self HashMap[K, V]) Keys() Iterator[K]
- func (self HashMap[K, V]) Len() USize
- func (self *HashMap[K, V]) Remove(key K) Option[V]
- func (self HashMap[K, V]) Values() Iterator[V]
- type HashMapIter
- func (self HashMapIter[K, V]) CollectToLinkedList() LinkedList[Pair[K, V]]
- func (self HashMapIter[K, V]) CollectToVec() Vec[Pair[K, V]]
- func (self HashMapIter[K, V]) Filter(f func(Pair[K, V]) Bool) Iterator[Pair[K, V]]
- func (self HashMapIter[K, V]) Fold(init Pair[K, V], f func(Pair[K, V], Pair[K, V]) Pair[K, V]) Pair[K, V]
- func (self HashMapIter[K, V]) Map(f func(Pair[K, V]) Pair[K, V]) Iterator[Pair[K, V]]
- func (self *HashMapIter[K, V]) Next() Option[Pair[K, V]]
- func (self HashMapIter[K, V]) Rev() Iterator[Pair[K, V]]
- type HashMapKeys
- func (self HashMapKeys[K]) CollectToLinkedList() LinkedList[K]
- func (self HashMapKeys[K]) CollectToVec() Vec[K]
- func (self HashMapKeys[K]) Filter(f func(K) Bool) Iterator[K]
- func (self HashMapKeys[K]) Fold(init K, f func(K, K) K) K
- func (self HashMapKeys[K]) Map(f func(K) K) Iterator[K]
- func (self *HashMapKeys[K]) Next() Option[K]
- func (self HashMapKeys[K]) Rev() Iterator[K]
- type HashMapValues
- func (self HashMapValues[V]) CollectToLinkedList() LinkedList[V]
- func (self HashMapValues[V]) CollectToVec() Vec[V]
- func (self HashMapValues[V]) Filter(f func(V) Bool) Iterator[V]
- func (self HashMapValues[V]) Fold(init V, f func(V, V) V) V
- func (self HashMapValues[V]) Map(f func(V) V) Iterator[V]
- func (self *HashMapValues[V]) Next() Option[V]
- func (self HashMapValues[V]) Rev() Iterator[V]
- type HashSet
- func (self HashSet[K]) AsSlice() []K
- func (self *HashSet[K]) Clear()
- func (self HashSet[K]) Contains(value K) Bool
- func (self HashSet[K]) Debug() String
- func (self HashSet[K]) Display() String
- func (self HashSet[K]) Get(value K) Option[K]
- func (self *HashSet[K]) Insert(value K) Bool
- func (self HashSet[K]) IntoIter() Iterator[K]
- func (self HashSet[K]) IsEmpty() Bool
- func (self HashSet[K]) Len() USize
- func (self *HashSet[K]) Remove(value K) Bool
- type HashSetIter
- func (self HashSetIter[K]) CollectToLinkedList() LinkedList[K]
- func (self HashSetIter[K]) CollectToVec() Vec[K]
- func (self HashSetIter[K]) Filter(f func(K) Bool) Iterator[K]
- func (self HashSetIter[K]) Fold(init K, f func(K, K) K) K
- func (self HashSetIter[K]) Map(f func(K) K) Iterator[K]
- func (self *HashSetIter[K]) Next() Option[K]
- func (self HashSetIter[K]) Rev() Iterator[K]
- type I16
- func (self I16) Add(rhs I16) I16
- func (self *I16) AddAssign(rhs I16)
- func (self I16) Clone() I16
- func (self I16) Cmp(rhs I16) Ordering
- func (self I16) Debug() String
- func (self I16) Display() String
- func (self I16) Div(rhs I16) I16
- func (self *I16) DivAssign(rhs I16)
- func (self I16) Eq(rhs I16) Bool
- func (self I16) Mul(rhs I16) I16
- func (self *I16) MulAssign(rhs I16)
- func (self I16) Sub(rhs I16) I16
- func (self *I16) SubAssign(rhs I16)
- func (self I16) ToString() String
- type I32
- func (self I32) Add(rhs I32) I32
- func (self *I32) AddAssign(rhs I32)
- func (self I32) Clone() I32
- func (self I32) Cmp(rhs I32) Ordering
- func (self I32) Debug() String
- func (self I32) Display() String
- func (self I32) Div(rhs I32) I32
- func (self *I32) DivAssign(rhs I32)
- func (self I32) Eq(rhs I32) Bool
- func (self I32) Mul(rhs I32) I32
- func (self *I32) MulAssign(rhs I32)
- func (self I32) Sub(rhs I32) I32
- func (self *I32) SubAssign(rhs I32)
- func (self I32) ToString() String
- type I64
- func (self I64) Add(rhs I64) I64
- func (self *I64) AddAssign(rhs I64)
- func (self I64) Clone() I64
- func (self I64) Cmp(rhs I64) Ordering
- func (self I64) Debug() String
- func (self I64) Display() String
- func (self I64) Div(rhs I64) I64
- func (self *I64) DivAssign(rhs I64)
- func (self I64) Eq(rhs I64) Bool
- func (self I64) Mul(rhs I64) I64
- func (self *I64) MulAssign(rhs I64)
- func (self I64) Sub(rhs I64) I64
- func (self *I64) SubAssign(rhs I64)
- func (self I64) ToString() String
- type I8
- func (self I8) Add(rhs I8) I8
- func (self *I8) AddAssign(rhs I8)
- func (self I8) Clone() I8
- func (self I8) Cmp(rhs I8) Ordering
- func (self I8) Debug() String
- func (self I8) Display() String
- func (self I8) Div(rhs I8) I8
- func (self *I8) DivAssign(rhs I8)
- func (self I8) Eq(rhs I8) Bool
- func (self I8) Mul(rhs I8) I8
- func (self *I8) MulAssign(rhs I8)
- func (self I8) Sub(rhs I8) I8
- func (self *I8) SubAssign(rhs I8)
- func (self I8) ToString() String
- type ISize
- func (self ISize) Add(rhs ISize) ISize
- func (self *ISize) AddAssign(rhs ISize)
- func (self ISize) Clone() ISize
- func (self ISize) Cmp(rhs ISize) Ordering
- func (self ISize) Debug() String
- func (self ISize) Display() String
- func (self ISize) Div(rhs ISize) ISize
- func (self *ISize) DivAssign(rhs ISize)
- func (self ISize) Eq(rhs ISize) Bool
- func (self ISize) Mul(rhs ISize) ISize
- func (self *ISize) MulAssign(rhs ISize)
- func (self ISize) Sub(rhs ISize) ISize
- func (self *ISize) SubAssign(rhs ISize)
- func (self ISize) ToString() String
- type IntoIterator
- type Iterator
- type LinkedList
- func (list *LinkedList[T]) Append(other *LinkedList[T])
- func (list *LinkedList[T]) Back() Option[*T]
- func (list *LinkedList[T]) Clear()
- func (self LinkedList[T]) Debug() String
- func (self LinkedList[T]) Display() String
- func (list *LinkedList[T]) Front() Option[*T]
- func (list *LinkedList[T]) IntoIter() Iterator[T]
- func (list LinkedList[T]) IsEmpty() Bool
- func (list LinkedList[T]) Len() USize
- func (list *LinkedList[T]) PopBack() Option[T]
- func (list *LinkedList[T]) PopFront() Option[T]
- func (list *LinkedList[T]) PushBack(value T)
- func (list *LinkedList[T]) PushFront(value T)
- type LinkedListIter
- func (self LinkedListIter[T]) CollectToLinkedList() LinkedList[T]
- func (self LinkedListIter[T]) CollectToVec() Vec[T]
- func (self LinkedListIter[T]) Filter(f func(T) Bool) Iterator[T]
- func (self LinkedListIter[T]) Fold(init T, f func(T, T) T) T
- func (self LinkedListIter[T]) Map(f func(T) T) Iterator[T]
- func (self *LinkedListIter[T]) Next() Option[T]
- func (self LinkedListIter[T]) Rev() Iterator[T]
- type LinkedListNode
- type Mul
- type MulAssign
- type Option
- func (self Option[T]) And(optb Option[any]) Option[any]
- func (self Option[T]) AndThen(f func(T) Option[any]) Option[any]
- func (self Option[T]) Debug() String
- func (self Option[T]) Display() String
- func (self Option[T]) Expect(message string) T
- func (self Option[T]) Filter(predicate func(T) Bool) Option[T]
- func (self *Option[T]) GetOrInsert(value T) *T
- func (self *Option[T]) GetOrInsertWith(f func() T) *T
- func (self *Option[T]) Insert(value T) *T
- func (self Option[T]) IsNone() Bool
- func (self Option[T]) IsSome() Bool
- func (self *Option[T]) IsSomeAnd(f func(T) Bool) Bool
- func (self Option[T]) Map(f func(T) T) Option[T]
- func (self Option[T]) MapOr(defaultValue T, f func(T) T) T
- func (self Option[T]) MapOrElse(defaultValue func() T, f func(T) T) T
- func (self Option[T]) Or(optb Option[T]) Option[T]
- func (self Option[T]) OrElse(f func() Option[T]) Option[T]
- func (self *Option[T]) Replace(value T) Option[T]
- func (self *Option[T]) Take() Option[T]
- func (self Option[T]) Unwrap() T
- func (self Option[T]) UnwrapOr(value T) T
- func (self Option[T]) UnwrapOrElse(f func() T) T
- func (self Option[T]) Xor(optb Option[T]) Option[T]
- type Ord
- type Ordering
- type Pair
- type Result
- func Copy(from String, to String) Result[any]
- func CreateDir(path String) Result[any]
- func Err[T any](err error) Result[T]
- func Ok[T any](value T) Result[T]
- func Read(path String) Result[[]Byte]
- func ReadDir(path String) Result[Vec[DirEntry]]
- func ReadToString(path String) Result[String]
- func RemoveDir(path String) Result[any]
- func RemoveFile(path String) Result[any]
- func Rename(from String, to String) Result[any]
- func Write(path String, data []Byte) Result[any]
- func (self Result[T]) And(res Result[T]) Result[T]
- func (self Result[T]) AndThen(op func(T) Result[T]) Result[T]
- func (self Result[T]) Debug() String
- func (self Result[T]) Display() String
- func (self Result[T]) Err() Option[error]
- func (self Result[T]) Expect(message string) T
- func (self Result[T]) ExpectErr(message string) error
- func (self Result[T]) IsErr() Bool
- func (self Result[T]) IsErrAnd(predicate func(error) Bool) Bool
- func (self Result[T]) IsOk() Bool
- func (self Result[T]) IsOkAnd(predicate func(T) Bool) Bool
- func (self Result[T]) Map(f func(T) T) Result[T]
- func (self Result[T]) MapErr(f func(error) error) Result[T]
- func (self Result[T]) MapOr(defaultValue T, f func(T) T) T
- func (self Result[T]) MapOrElse(defaultValue func() T, f func(T) T) T
- func (self Result[T]) Ok() Option[T]
- func (self Result[T]) Or(res Result[T]) Result[T]
- func (self Result[T]) OrElse(op func(error) Result[T]) Result[T]
- func (self Result[T]) Unwrap() T
- func (self Result[T]) UnwrapErr() error
- func (self Result[T]) UnwrapOr(defaultValue T) T
- func (self Result[T]) UnwrapOrElse(f func() T) T
- type Stdin
- type String
- func (self String) Add(rhs String) String
- func (self *String) AddAssign(rhs String)
- func (self String) Clone() String
- func (self String) Cmp(rhs String) Ordering
- func (self String) Debug() String
- func (self String) Display() String
- func (self String) Eq(rhs String) Bool
- func (self String) ToString() String
- type Sub
- type SubAssign
- type ToString
- type U16
- func (self U16) Add(rhs U16) U16
- func (self *U16) AddAssign(rhs U16)
- func (self U16) Clone() U16
- func (self U16) Cmp(rhs U16) Ordering
- func (self U16) Debug() String
- func (self U16) Display() String
- func (self U16) Div(rhs U16) U16
- func (self *U16) DivAssign(rhs U16)
- func (self U16) Eq(rhs U16) Bool
- func (self U16) Mul(rhs U16) U16
- func (self *U16) MulAssign(rhs U16)
- func (self U16) Sub(rhs U16) U16
- func (self *U16) SubAssign(rhs U16)
- func (self U16) ToString() String
- type U32
- func (self U32) Add(rhs U32) U32
- func (self *U32) AddAssign(rhs U32)
- func (self U32) Clone() U32
- func (self U32) Cmp(rhs U32) Ordering
- func (self U32) Debug() String
- func (self U32) Display() String
- func (self U32) Div(rhs U32) U32
- func (self *U32) DivAssign(rhs U32)
- func (self U32) Eq(rhs U32) Bool
- func (self U32) Mul(rhs U32) U32
- func (self *U32) MulAssign(rhs U32)
- func (self U32) Sub(rhs U32) U32
- func (self *U32) SubAssign(rhs U32)
- func (self U32) ToString() String
- type U64
- func (self U64) Add(rhs U64) U64
- func (self *U64) AddAssign(rhs U64)
- func (self U64) Clone() U64
- func (self U64) Cmp(rhs U64) Ordering
- func (self U64) Debug() String
- func (self U64) Display() String
- func (self U64) Div(rhs U64) U64
- func (self *U64) DivAssign(rhs U64)
- func (self U64) Eq(rhs U64) Bool
- func (self U64) Mul(rhs U64) U64
- func (self *U64) MulAssign(rhs U64)
- func (self U64) Sub(rhs U64) U64
- func (self *U64) SubAssign(rhs U64)
- func (self U64) ToString() String
- type U8
- func (self U8) Add(rhs U8) U8
- func (self *U8) AddAssign(rhs U8)
- func (self U8) Clone() U8
- func (self U8) Cmp(rhs U8) Ordering
- func (self U8) Debug() String
- func (self U8) Display() String
- func (self U8) Div(rhs U8) U8
- func (self *U8) DivAssign(rhs U8)
- func (self U8) Eq(rhs U8) Bool
- func (self U8) Mul(rhs U8) U8
- func (self *U8) MulAssign(rhs U8)
- func (self U8) Sub(rhs U8) U8
- func (self *U8) SubAssign(rhs U8)
- func (self U8) ToString() String
- type USize
- func (self USize) Add(rhs USize) USize
- func (self *USize) AddAssign(rhs USize)
- func (self USize) Clone() USize
- func (self USize) Cmp(rhs USize) Ordering
- func (self USize) Debug() String
- func (self USize) Display() String
- func (self USize) Div(rhs USize) USize
- func (self *USize) DivAssign(rhs USize)
- func (self USize) Eq(rhs USize) Bool
- func (self USize) Mul(rhs USize) USize
- func (self *USize) MulAssign(rhs USize)
- func (self USize) Sub(rhs USize) USize
- func (self *USize) SubAssign(rhs USize)
- func (self USize) ToString() String
- type Vec
- func (self *Vec[T]) Append(other *Vec[T])
- func (self Vec[T]) AsSlice() []T
- func (self Vec[T]) BinarySearch(value T) Option[USize]
- func (self Vec[T]) BinarySearchBy(f func(T) Ordering) Option[USize]
- func (self Vec[T]) Capacity() USize
- func (self *Vec[T]) Clear()
- func (self Vec[T]) Contains(value T) Bool
- func (self Vec[T]) Debug() String
- func (self *Vec[T]) Dedup()
- func (self *Vec[T]) DedupByKey(key func(T) any)
- func (self Vec[T]) Display() String
- func (self *Vec[T]) Fill(value T)
- func (self *Vec[T]) FillWith(f func() T)
- func (self Vec[T]) Get(index USize) Option[T]
- func (self Vec[T]) GetUnchecked(index USize) T
- func (self *Vec[T]) Insert(index USize, value T)
- func (self Vec[T]) IntoIter() Iterator[T]
- func (self Vec[T]) IsEmpty() Bool
- func (self Vec[T]) Len() USize
- func (self *Vec[T]) Pop() Option[T]
- func (self *Vec[T]) Push(value T)
- func (self *Vec[T]) Reserve(additional USize)
- func (self *Vec[T]) Retain(predicate func(T) Bool)
- func (self *Vec[T]) Reverse()
- func (self *Vec[T]) Set(index USize, value T) Option[T]
- func (self *Vec[T]) SetUnchecked(index USize, value T)
- func (self *Vec[T]) Sort()
- func (self *Vec[T]) SortBy(compare func(T, T) Ordering)
- func (self *Vec[T]) SortUnstable()
- func (self *Vec[T]) SortUnstableBy(compare func(T, T) Ordering)
- func (self *Vec[T]) Swap(a, b USize)
- type VecIter
- func (self VecIter[T]) CollectToLinkedList() LinkedList[T]
- func (self VecIter[T]) CollectToVec() Vec[T]
- func (self VecIter[T]) Filter(f func(T) Bool) Iterator[T]
- func (self VecIter[T]) Fold(init T, f func(T, T) T) T
- func (self VecIter[T]) Map(f func(T) T) Iterator[T]
- func (self *VecIter[T]) Next() Option[T]
- func (self VecIter[T]) Rev() Iterator[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Add ¶
type Add[T any] interface { Add(rhs T) T }
Add is a trait for types that support addition.
type AddAssign ¶
type AddAssign[T any] interface { AddAssign(rhs T) }
The addition assignment operator +=.
type BTreeMap ¶ added in v0.7.0
func BTreeMapNew ¶ added in v0.7.0
Creates an empty BTreeMap.
func (*BTreeMap[K, V]) Clear ¶ added in v0.7.0
func (self *BTreeMap[K, V]) Clear()
Clears the map, removing all elements.
func (*BTreeMap[K, V]) ContainsKey ¶ added in v0.7.0
Returns true if the map contains a value for the specified key. The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.
func (*BTreeMap[K, V]) Insert ¶ added in v0.7.0
Inserts a key-value pair into the map. If the map did not have this key present, None is returned. If the map did have this key present, the value is updated, and the old value is returned. The key is not updated, though; this matters for types that can be == without being identical. See the module-level documentation for more.
func (BTreeMap[K, V]) Keys ¶ added in v0.7.0
An iterator visiting all keys in arbitrary order. The iterator element type is K.
type BTreeMapIter ¶ added in v0.7.0
func (BTreeMapIter[K, V]) CollectToLinkedList ¶ added in v0.7.0
func (self BTreeMapIter[K, V]) CollectToLinkedList() LinkedList[Pair[K, V]]
Collect to LinkedList
func (BTreeMapIter[K, V]) CollectToVec ¶ added in v0.7.0
func (self BTreeMapIter[K, V]) CollectToVec() Vec[Pair[K, V]]
func (*BTreeMapIter[K, V]) Filter ¶ added in v0.7.0
func (self *BTreeMapIter[K, V]) Filter(f func(Pair[K, V]) Bool) Iterator[Pair[K, V]]
filter
func (*BTreeMapIter[K, V]) Fold ¶ added in v0.7.0
func (self *BTreeMapIter[K, V]) Fold(init Pair[K, V], f func(Pair[K, V], Pair[K, V]) Pair[K, V]) Pair[K, V]
fold
func (*BTreeMapIter[K, V]) Map ¶ added in v0.7.0
func (self *BTreeMapIter[K, V]) Map(f func(Pair[K, V]) Pair[K, V]) Iterator[Pair[K, V]]
map
func (*BTreeMapIter[K, V]) Next ¶ added in v0.7.0
func (self *BTreeMapIter[K, V]) Next() Option[Pair[K, V]]
next
func (BTreeMapIter[K, V]) Rev ¶ added in v0.7.0
func (self BTreeMapIter[K, V]) Rev() Iterator[Pair[K, V]]
rev
type BTreeMapKeys ¶ added in v0.7.0
type BTreeMapKeys[K any] struct { // contains filtered or unexported fields }
func (BTreeMapKeys[K]) CollectToLinkedList ¶ added in v0.7.0
func (self BTreeMapKeys[K]) CollectToLinkedList() LinkedList[K]
Collect to LinkedList
func (BTreeMapKeys[K]) CollectToVec ¶ added in v0.7.0
func (self BTreeMapKeys[K]) CollectToVec() Vec[K]
Collect to Vec
func (*BTreeMapKeys[K]) Filter ¶ added in v0.7.0
func (self *BTreeMapKeys[K]) Filter(f func(K) Bool) Iterator[K]
filter
func (*BTreeMapKeys[K]) Fold ¶ added in v0.7.0
func (self *BTreeMapKeys[K]) Fold(init K, f func(K, K) K) K
fold
func (*BTreeMapKeys[K]) Map ¶ added in v0.7.0
func (self *BTreeMapKeys[K]) Map(f func(K) K) Iterator[K]
map
type BTreeMapValues ¶ added in v0.7.0
type BTreeMapValues[V any] struct { // contains filtered or unexported fields }
func (BTreeMapValues[V]) CollectToLinkedList ¶ added in v0.7.0
func (self BTreeMapValues[V]) CollectToLinkedList() LinkedList[V]
Collect to LinkedList
func (BTreeMapValues[V]) CollectToVec ¶ added in v0.7.0
func (self BTreeMapValues[V]) CollectToVec() Vec[V]
Collect to Vec
func (*BTreeMapValues[V]) Filter ¶ added in v0.7.0
func (self *BTreeMapValues[V]) Filter(f func(V) Bool) Iterator[V]
filter
func (*BTreeMapValues[V]) Fold ¶ added in v0.7.0
func (self *BTreeMapValues[V]) Fold(init V, f func(V, V) V) V
fold
func (*BTreeMapValues[V]) Map ¶ added in v0.7.0
func (self *BTreeMapValues[V]) Map(f func(V) V) Iterator[V]
map
func (*BTreeMapValues[V]) Next ¶ added in v0.7.0
func (self *BTreeMapValues[V]) Next() Option[V]
next
type BTreeSet ¶ added in v0.7.0
type BTreeSet[K Ord[K]] struct { // contains filtered or unexported fields }
func BTreeSetNew ¶ added in v0.7.0
Creates an empty BTreeSet.
func (*BTreeSet[K]) Clear ¶ added in v0.7.0
func (self *BTreeSet[K]) Clear()
Clears the set, removing all elements.
func (*BTreeSet[K]) Contains ¶ added in v0.7.0
Returns true if the set contains an element equal to the value. The value may be any borrowed form of the set’s element type, but the ordering on the borrowed form must match the ordering on the element type.
func (*BTreeSet[K]) Insert ¶ added in v0.7.0
Adds a value to the set. Returns whether the value was newly inserted. That is: If the set did not previously contain an equal value, true is returned. If the set already contained an equal value, false is returned, and the entry is not updated.
func (*BTreeSet[K]) Remove ¶ added in v0.7.0
If the set contains an element equal to the value, removes it from the set and drops it. Returns whether such an element was present. The value may be any borrowed form of the set’s element type, but the ordering on the borrowed form must match the ordering on the element type.
type BTreeSetIter ¶ added in v0.7.0
type BTreeSetIter[K Ord[K]] struct { // contains filtered or unexported fields }
func (BTreeSetIter[K]) CollectToLinkedList ¶ added in v0.7.0
func (self BTreeSetIter[K]) CollectToLinkedList() LinkedList[K]
Collect to LinkedList
func (BTreeSetIter[K]) CollectToVec ¶ added in v0.7.0
func (self BTreeSetIter[K]) CollectToVec() Vec[K]
Collect to Vec
func (BTreeSetIter[K]) Filter ¶ added in v0.7.0
func (self BTreeSetIter[K]) Filter(f func(K) Bool) Iterator[K]
filter
func (BTreeSetIter[K]) Fold ¶ added in v0.7.0
func (self BTreeSetIter[K]) Fold(init K, f func(K, K) K) K
fold
func (BTreeSetIter[K]) Map ¶ added in v0.7.0
func (self BTreeSetIter[K]) Map(f func(K) K) Iterator[K]
map
type Complex128 ¶
type Complex128 complex128
func (Complex128) Add ¶ added in v0.6.0
func (self Complex128) Add(rhs Complex128) Complex128
func (*Complex128) AddAssign ¶ added in v0.6.0
func (self *Complex128) AddAssign(rhs Complex128)
func (Complex128) Clone ¶
func (self Complex128) Clone() Complex128
func (Complex128) Debug ¶
func (self Complex128) Debug() String
func (Complex128) Display ¶
func (self Complex128) Display() String
func (Complex128) Div ¶ added in v0.6.0
func (self Complex128) Div(rhs Complex128) Complex128
func (*Complex128) DivAssign ¶ added in v0.6.0
func (self *Complex128) DivAssign(rhs Complex128)
func (Complex128) Mul ¶ added in v0.6.0
func (self Complex128) Mul(rhs Complex128) Complex128
func (*Complex128) MulAssign ¶ added in v0.6.0
func (self *Complex128) MulAssign(rhs Complex128)
func (Complex128) Sub ¶ added in v0.6.0
func (self Complex128) Sub(rhs Complex128) Complex128
func (*Complex128) SubAssign ¶ added in v0.6.0
func (self *Complex128) SubAssign(rhs Complex128)
func (Complex128) ToString ¶
func (self Complex128) ToString() String
type Default ¶
type Default[T any] interface { Default() T }
A trait for giving a type a useful default value.
type Div ¶
type Div[T any] interface { Div(rhs T) T }
Div is a trait for types that support division.
type DivAssign ¶
type DivAssign[T any] interface { DivAssign(rhs T) }
The division assignment operator /=.
type HashMap ¶
type HashMap[K comparable, V any] struct { // contains filtered or unexported fields }
func HashMapWithCapacity ¶
func HashMapWithCapacity[K comparable, V any](capacity USize) HashMap[K, V]
Creates an empty HashMap with at least the specified capacity.
func (*HashMap[K, V]) Clear ¶
func (self *HashMap[K, V]) Clear()
Clears the map, removing all key-value pairs. Keeps the allocated memory for reuse.
func (HashMap[K, V]) ContainsKey ¶
Returns true if the map contains a value for the specified key.
func (*HashMap[K, V]) Insert ¶
Inserts a key-value pair into the map. If the map did not have this key present, None is returned.
func (HashMap[K, V]) Keys ¶
An iterator visiting all keys in arbitrary order. The iterator element type is K.
type HashMapIter ¶
type HashMapIter[K comparable, V any] struct { // contains filtered or unexported fields }
func (HashMapIter[K, V]) CollectToLinkedList ¶ added in v0.6.0
func (self HashMapIter[K, V]) CollectToLinkedList() LinkedList[Pair[K, V]]
Collect to LinkedList
func (HashMapIter[K, V]) CollectToVec ¶
func (self HashMapIter[K, V]) CollectToVec() Vec[Pair[K, V]]
func (HashMapIter[K, V]) Filter ¶
func (self HashMapIter[K, V]) Filter(f func(Pair[K, V]) Bool) Iterator[Pair[K, V]]
filter
func (HashMapIter[K, V]) Fold ¶
func (self HashMapIter[K, V]) Fold(init Pair[K, V], f func(Pair[K, V], Pair[K, V]) Pair[K, V]) Pair[K, V]
fold
type HashMapKeys ¶
type HashMapKeys[K any] struct { // contains filtered or unexported fields }
func (HashMapKeys[K]) CollectToLinkedList ¶ added in v0.6.0
func (self HashMapKeys[K]) CollectToLinkedList() LinkedList[K]
Collect to LinkedList
func (HashMapKeys[K]) CollectToVec ¶
func (self HashMapKeys[K]) CollectToVec() Vec[K]
Collect to Vec
type HashMapValues ¶
type HashMapValues[V any] struct { // contains filtered or unexported fields }
func (HashMapValues[V]) CollectToLinkedList ¶ added in v0.6.0
func (self HashMapValues[V]) CollectToLinkedList() LinkedList[V]
Collect to LinkedList
func (HashMapValues[V]) CollectToVec ¶
func (self HashMapValues[V]) CollectToVec() Vec[V]
Collect to Vec
func (HashMapValues[V]) Filter ¶
func (self HashMapValues[V]) Filter(f func(V) Bool) Iterator[V]
filter
type HashSet ¶ added in v0.7.0
type HashSet[K comparable] struct { // contains filtered or unexported fields }
func HashSetFromSlice ¶ added in v0.7.0
func HashSetFromSlice[K comparable](slice []K) HashSet[K]
From Slice
func HashSetNew ¶ added in v0.7.0
func HashSetNew[K comparable]() HashSet[K]
Creates an empty HashSet.
func HashSetWithCapacity ¶ added in v0.7.0
func HashSetWithCapacity[K comparable](capacity USize) HashSet[K]
Creates an empty HashSet with at least the specified capacity.
func (*HashSet[K]) Clear ¶ added in v0.7.0
func (self *HashSet[K]) Clear()
Clears the set, removing all values.
func (HashSet[K]) Contains ¶ added in v0.7.0
Returns true if the set contains a value. The value may be any borrowed form of the set’s value type, but Hash and Eq on the borrowed form must match those for the value type.
func (HashSet[K]) Get ¶ added in v0.7.0
Returns a reference to the value in the set, if any, that is equal to the given value. The value may be any borrowed form of the set’s value type, but Hash and Eq on the borrowed form must match those for the value type.
func (*HashSet[K]) Insert ¶ added in v0.7.0
Adds a value to the set. Returns whether the value was newly inserted. That is: If the set did not previously contain this value, true is returned. If the set already contained this value, false is returned, and the set is not modified: original value is not replaced, and the value passed as argument is dropped.
type HashSetIter ¶ added in v0.7.0
type HashSetIter[K comparable] struct { // contains filtered or unexported fields }
func (HashSetIter[K]) CollectToLinkedList ¶ added in v0.7.0
func (self HashSetIter[K]) CollectToLinkedList() LinkedList[K]
Collect to LinkedList
func (HashSetIter[K]) CollectToVec ¶ added in v0.7.0
func (self HashSetIter[K]) CollectToVec() Vec[K]
Collect to Vec
func (HashSetIter[K]) Filter ¶ added in v0.7.0
func (self HashSetIter[K]) Filter(f func(K) Bool) Iterator[K]
filter
func (HashSetIter[K]) Fold ¶ added in v0.7.0
func (self HashSetIter[K]) Fold(init K, f func(K, K) K) K
fold
func (HashSetIter[K]) Map ¶ added in v0.7.0
func (self HashSetIter[K]) Map(f func(K) K) Iterator[K]
map
type ISize ¶ added in v0.6.0
type ISize int
type IntoIterator ¶
type LinkedList ¶ added in v0.5.0
type LinkedList[T any] struct { // contains filtered or unexported fields }
func LinkedListNew ¶ added in v0.5.0
func LinkedListNew[T any]() LinkedList[T]
Creates an empty LinkedList.
func (*LinkedList[T]) Append ¶ added in v0.5.0
func (list *LinkedList[T]) Append(other *LinkedList[T])
Moves all elements from other to the end of the list. This reuses all the nodes from other and moves them into self. After this operation, other becomes empty. This operation should compute in O(1) time and O(1) memory.
func (*LinkedList[T]) Back ¶ added in v0.5.0
func (list *LinkedList[T]) Back() Option[*T]
Provides a reference to the back element, or None if the list is empty. This operation should compute in O(1) time.
func (*LinkedList[T]) Clear ¶ added in v0.5.0
func (list *LinkedList[T]) Clear()
Removes all elements from the LinkedList. This operation should compute in O(1) time. +GC
func (LinkedList[T]) Debug ¶ added in v0.5.0
func (self LinkedList[T]) Debug() String
impl Debug for LinkedList
func (LinkedList[T]) Display ¶ added in v0.5.0
func (self LinkedList[T]) Display() String
impl Display for LinkedList
func (*LinkedList[T]) Front ¶ added in v0.5.0
func (list *LinkedList[T]) Front() Option[*T]
Provides a reference to the front element, or None if the list is empty. This operation should compute in O(1) time.
func (*LinkedList[T]) IntoIter ¶ added in v0.5.0
func (list *LinkedList[T]) IntoIter() Iterator[T]
into_iter
func (LinkedList[T]) IsEmpty ¶ added in v0.5.0
func (list LinkedList[T]) IsEmpty() Bool
Returns true if the LinkedList is empty. This operation should compute in O(1) time.
func (LinkedList[T]) Len ¶ added in v0.5.0
func (list LinkedList[T]) Len() USize
Returns the length of the LinkedList. This operation should compute in O(1) time.
func (*LinkedList[T]) PopBack ¶ added in v0.5.0
func (list *LinkedList[T]) PopBack() Option[T]
Removes the last element from a list and returns it, or None if it is empty. This operation should compute in O(1) time.
func (*LinkedList[T]) PopFront ¶ added in v0.5.0
func (list *LinkedList[T]) PopFront() Option[T]
Removes the first element and returns it, or None if the list is empty. This operation should compute in O(1) time.
func (*LinkedList[T]) PushBack ¶ added in v0.5.0
func (list *LinkedList[T]) PushBack(value T)
Appends an element to the back of a list. This operation should compute in O(1) time.
func (*LinkedList[T]) PushFront ¶ added in v0.5.0
func (list *LinkedList[T]) PushFront(value T)
Adds an element first in the list. This operation should compute in O(1) time.
type LinkedListIter ¶ added in v0.5.0
type LinkedListIter[T any] struct { // contains filtered or unexported fields }
func (LinkedListIter[T]) CollectToLinkedList ¶ added in v0.6.0
func (self LinkedListIter[T]) CollectToLinkedList() LinkedList[T]
func (LinkedListIter[T]) CollectToVec ¶ added in v0.5.0
func (self LinkedListIter[T]) CollectToVec() Vec[T]
func (LinkedListIter[T]) Filter ¶ added in v0.5.0
func (self LinkedListIter[T]) Filter(f func(T) Bool) Iterator[T]
filter
func (LinkedListIter[T]) Fold ¶ added in v0.5.0
func (self LinkedListIter[T]) Fold(init T, f func(T, T) T) T
fold
func (LinkedListIter[T]) Map ¶ added in v0.5.0
func (self LinkedListIter[T]) Map(f func(T) T) Iterator[T]
map
func (*LinkedListIter[T]) Next ¶ added in v0.5.0
func (self *LinkedListIter[T]) Next() Option[T]
next
type LinkedListNode ¶ added in v0.5.0
type LinkedListNode[T any] struct { // contains filtered or unexported fields }
type Mul ¶
type Mul[T any] interface { Mul(rhs T) T }
Mul is a trait for types that support multiplication.
type MulAssign ¶
type MulAssign[T any] interface { MulAssign(rhs T) }
The multiplication assignment operator *=.
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
func (Option[T]) And ¶
Returns None if the option is None, otherwise returns optb. Arguments passed to and are eagerly evaluated; if you are passing the result of a function call, it is recommended to use and_then, which is lazily evaluated.
func (Option[T]) AndThen ¶
Returns None if the option is None, otherwise calls f with the wrapped value and returns the result. Some languages call this operation flatmap.
func (Option[T]) Filter ¶
Returns None if the option is None, otherwise calls predicate with the wrapped value and returns: 1. Some(t) if predicate returns true (where t is the wrapped value), and 2. None if predicate returns false.
func (*Option[T]) GetOrInsert ¶
func (self *Option[T]) GetOrInsert(value T) *T
Inserts value into the option if it is None, then returns a mutable reference to the contained value. See also Option::insert, which updates the value even if the option already contains Some.
func (*Option[T]) GetOrInsertWith ¶
func (self *Option[T]) GetOrInsertWith(f func() T) *T
Inserts a value computed from f into the option if it is None, then returns a mutable reference to the contained value.
func (*Option[T]) Insert ¶
func (self *Option[T]) Insert(value T) *T
Inserts value into the option, then returns a mutable reference to it. If the option already contains a value, the old value is dropped. See also Option::get_or_insert, which doesn’t update the value if the option already contains Some.
func (*Option[T]) IsSomeAnd ¶
Returns true if the option is a Some and the value inside of it matches a predicate.
func (Option[T]) Map ¶
Maps an Option<T> to other Option<T> by applying a function to a contained value (if Some) or returns None (if None).
func (Option[T]) MapOr ¶
func (self Option[T]) MapOr(defaultValue T, f func(T) T) T
Returns the provided default result (if none), or applies a function to the contained value (if any). Arguments passed to map_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use map_or_else, which is lazily evaluated.
func (Option[T]) MapOrElse ¶
func (self Option[T]) MapOrElse(defaultValue func() T, f func(T) T) T
Computes a default function result (if none), or applies a different function to the contained value (if any).
func (Option[T]) Or ¶
Returns the option if it contains a value, otherwise returns optb. Arguments passed to or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use or_else, which is lazily evaluated.
func (Option[T]) OrElse ¶
Returns the option if it contains a value, otherwise calls f and returns the result.
func (*Option[T]) Replace ¶
Replaces the actual value in the option by the value given in parameter, returning the old value if present, leaving a Some in its place without deinitializing either one.
func (Option[T]) Unwrap ¶
func (self Option[T]) Unwrap() T
Returns the contained Some value, consuming the self value. Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the None case explicitly, or call unwrap_or, unwrap_or_else, or unwrap_or_default.
func (Option[T]) UnwrapOr ¶
func (self Option[T]) UnwrapOr(value T) T
Returns the contained Some value or a provided default. Arguments passed to unwrap_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use unwrap_or_else, which is lazily evaluated.
func (Option[T]) UnwrapOrElse ¶
func (self Option[T]) UnwrapOrElse(f func() T) T
Returns the contained Some value or computes it from a closure.
type Pair ¶
type Result ¶
type Result[T any] struct { // contains filtered or unexported fields }
func Copy ¶
Copies the contents of one file to another. This function will also copy the permission bits of the original file to the destination file. This function will overwrite the contents of to.
func ReadToString ¶
Read the entire contents of a file into a string.
func Rename ¶
Rename a file or directory to a new name, replacing the original file if to already exists. This will not work if the new name is on a different mount point.
func (Result[T]) And ¶
Returns res if the result is Ok, otherwise returns the Err value of self. Arguments passed to and are eagerly evaluated; if you are passing the result of a function call, it is recommended to use and_then, which is lazily evaluated.
func (Result[T]) AndThen ¶
Calls op if the result is Ok, otherwise returns the Err value of self. This function can be used for control flow based on Result values.
func (Result[T]) Err ¶
Converts from Result<T, E> to Option<E>. Converts self into an Option<E>, consuming self, and discarding the success value, if any.
func (Result[T]) Expect ¶
Returns the contained Ok value, consuming the self value. Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the Err case explicitly, or call unwrap_or, unwrap_or_else, or unwrap_or_default.
func (Result[T]) IsErrAnd ¶
Returns true if the result is Err and the value inside of it matches a predicate.
func (Result[T]) IsOkAnd ¶
Returns true if the result is Ok and the value inside of it matches a predicate.
func (Result[T]) Map ¶
Maps a Result<T, E> to Result<U, E> by applying a function to a contained Ok value, leaving an Err value untouched. This function can be used to compose the results of two functions.
func (Result[T]) MapErr ¶
Maps a Result<T, E> to Result<T, F> by applying a function to a contained Err value, leaving an Ok value untouched. This function can be used to pass through a successful result while handling an error.
func (Result[T]) MapOr ¶
func (self Result[T]) MapOr(defaultValue T, f func(T) T) T
Returns the provided default (if Err), or applies a function to the contained value (if Ok), Arguments passed to map_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use map_or_else, which is lazily evaluated.
func (Result[T]) MapOrElse ¶
func (self Result[T]) MapOrElse(defaultValue func() T, f func(T) T) T
Maps a Result<T, E> to U by applying fallback function default to a contained Err value, or function f to a contained Ok value. This function can be used to unpack a successful result while handling an error.
func (Result[T]) Ok ¶
Converts from Result<T, E> to Option<T>. Converts self into an Option<T>, consuming self, and discarding the error, if any.
func (Result[T]) Or ¶
Returns res if the result is Err, otherwise returns the Ok value of self. Arguments passed to or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use or_else, which is lazily evaluated.
func (Result[T]) OrElse ¶
Calls op if the result is Err, otherwise returns the Ok value of self. This function can be used for control flow based on result values.
func (Result[T]) Unwrap ¶
func (self Result[T]) Unwrap() T
Returns the contained Ok value, consuming the self value. Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the Err case explicitly, or call unwrap_or, unwrap_or_else, or unwrap_or_default.
func (Result[T]) UnwrapOr ¶
func (self Result[T]) UnwrapOr(defaultValue T) T
Returns the contained Ok value or a provided default. Arguments passed to unwrap_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use unwrap_or_else, which is lazily evaluated.
func (Result[T]) UnwrapOrElse ¶
func (self Result[T]) UnwrapOrElse(f func() T) T
Returns the contained Ok value or computes it from a closure.
type Stdin ¶
type Stdin struct {
// contains filtered or unexported fields
}
type Sub ¶
type Sub[T any] interface { Sub(rhs T) T }
Sub is a trait for types that support subtraction.
type SubAssign ¶
type SubAssign[T any] interface { SubAssign(rhs T) }
The subtraction assignment operator -=.
type Vec ¶
type Vec[T any] struct { // contains filtered or unexported fields }
func VecNew ¶
Constructs a new, empty Vec<T>. The vector will not allocate until elements are pushed onto it.
func VecWithCapacity ¶
Constructs a new, empty Vec<T> with at least the specified capacity.
func VecWithLen ¶
Constructs a new, empty Vec<T> with at least the specified capacity.
func (Vec[T]) AsSlice ¶
func (self Vec[T]) AsSlice() []T
Extracts a slice containing the entire vector.
func (Vec[T]) BinarySearch ¶
Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.
func (Vec[T]) BinarySearchBy ¶
Binary searches this slice with a comparator function. The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired target. If the slice is not sorted or if the comparator function does not implement an order consistent with the sort order of the underlying slice, the returned result is unspecified and meaningless.
func (Vec[T]) Capacity ¶
Returns the total number of elements the vector can hold without reallocating.
func (Vec[T]) Contains ¶
Returns true if the slice contains an element with the given value. This operation is O(n). Note that if you have a sorted slice, binary_search may be faster.
func (*Vec[T]) Dedup ¶
func (self *Vec[T]) Dedup()
Removes consecutive repeated elements in the vector according to the PartialEq trait implementation. If the vector is sorted, this removes all duplicates.
func (*Vec[T]) DedupByKey ¶
Removes all but the first of consecutive elements in the vector that resolve to the same key. If the vector is sorted, this removes all duplicates.
func (*Vec[T]) FillWith ¶
func (self *Vec[T]) FillWith(f func() T)
Fills self with elements returned by calling a closure repeatedly.
func (Vec[T]) Get ¶
Returns a reference to an element or subslice depending on the type of index. If given a position, returns a reference to the element at that position or None if out of bounds. If given a range, returns the subslice corresponding to that range, or None if out of bounds.
func (Vec[T]) GetUnchecked ¶
Returns a reference to an element or subslice, without doing bounds checking. For a safe alternative see get.
func (*Vec[T]) Insert ¶
Inserts an element at position index within the vector, shifting all elements after it to the right.
func (*Vec[T]) Push ¶
func (self *Vec[T]) Push(value T)
Appends an element to the back of a collection.
func (*Vec[T]) Reserve ¶
Reserves capacity for at least additional more elements to be inserted in the given Vec<T>. The collection may reserve more space to speculatively avoid frequent reallocations. After calling reserve, capacity will be greater than or equal to self.len() + additional. Does nothing if capacity is already sufficient.
func (*Vec[T]) Reverse ¶
func (self *Vec[T]) Reverse()
Reverses the order of elements in the slice, in place.
func (*Vec[T]) SetUnchecked ¶ added in v0.7.0
Set unchecked
func (*Vec[T]) Sort ¶
func (self *Vec[T]) Sort()
Sorts the slice. This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case. When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory. See sort_unstable.
func (*Vec[T]) SortBy ¶
Sorts the slice with a comparator function. This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case. The comparator function must define a total ordering for the elements in the slice. If the ordering is not total, the order of the elements is unspecified. An order is a total order if it is (for all a, b and c): - total and antisymmetric: exactly one of a < b, a == b or a > b is true, and - transitive, a < b and b < c implies a < c. The same must hold for both == and >.
func (*Vec[T]) SortUnstable ¶
func (self *Vec[T]) SortUnstable()
Sorts the slice, but might not preserve the order of equal elements. This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.
func (*Vec[T]) SortUnstableBy ¶
Sorts the slice with a comparator function, but might not preserve the order of equal elements. This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case. The comparator function must define a total ordering for the elements in the slice. If the ordering is not total, the order of the elements is unspecified. An order is a total order if it is (for all a, b and c): - total and antisymmetric: exactly one of a < b, a == b or a > b is true, and - transitive, a < b and b < c implies a < c. The same must hold for both == and >.
type VecIter ¶
type VecIter[T any] struct { // contains filtered or unexported fields }
func (VecIter[T]) CollectToLinkedList ¶ added in v0.6.0
func (self VecIter[T]) CollectToLinkedList() LinkedList[T]