memstorage

package
v1.0.0-rc.3.0...-64c530f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: Apache-2.0, BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SlotStorage

type SlotStorage[K comparable, V any] struct {
	// contains filtered or unexported fields
}

SlotStorage is an evictable storage that stores storages for slots.

func NewSlotStorage

func NewSlotStorage[K comparable, V any]() *SlotStorage[K, V]

NewSlotStorage creates a new slot storage.

func (*SlotStorage[K, V]) Evict

func (e *SlotStorage[K, V]) Evict(index slot.Index) (evictedStorage *shrinkingmap.ShrinkingMap[K, V])

Evict evicts the storage for the given index.

func (*SlotStorage[K, V]) ForEach

func (e *SlotStorage[K, V]) ForEach(f func(index slot.Index, storage *shrinkingmap.ShrinkingMap[K, V]))

ForEach iterates over all storages.

func (*SlotStorage[K, V]) Get

func (e *SlotStorage[K, V]) Get(index slot.Index, createIfMissing ...bool) (storage *shrinkingmap.ShrinkingMap[K, V])

Get returns the storage for the given index.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL