Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrIndexOutOfBounds = errors.New("index out of bounds")
)
Functions ¶
This section is empty.
Types ¶
type Slice ¶
type Slice[TItem any] interface { collection.Collection[TItem] // Unmarshal returns the underlying Go slice Unmarshal() []TItem // First returns the first item in the Slice First() *TItem // Last returns the last item in the Slice Last() *TItem // Add appends the given item to the Slice Add(TItem) // Get returns the item at the given index // in the Slice, otherwise returns nil and // the respective error Get(int) (*TItem, error) // Set value at the given index to the given // item in the Slice, returning any resulting // error Set(int, TItem) error // Insert adds the given item at the given index // in the Slice, returning any resulting error Insert(int, TItem) error // Remove removes and returns the item at the given // index in the size, otherwise returns nil and the // respective error Remove(int) (*TItem, error) }
Slice provides a thin abstraction over the primitive Go slice
func From ¶
func From[TItem any](c collection.Collection[TItem]) Slice[TItem]
Click to show internal directories.
Click to hide internal directories.