# Batches and Arenas

> Every output whose length scales with the call lands in an Arena, and the verb answers a view over it.

`import "github.com/unum-cloud/ustore"` 1.0.0-rc.1 · 084197c4

Every output whose length scales with the call lands in an `Arena`, and the verb answers a view over it. `NewArena(executor)` places one where that executor computes, and `NewArena(nil)` on host pages, and a call rewinds it, keeping its high-water mark, so a steady loop allocates once. A view read after a later call took its arena fails as `Contended`. A slice or segment an accessor returned is valid only until the arena’s next call. A result kept past the next call needs the next call to take another arena. An input lying inside the arena a call rewinds is refused with `StatusInvalidArgument`. A `Key` is sixteen bytes ordered as their bytes, and `KeyFromUint64` spells an integer big-endian, so integer keys order as integers.

```go
found, err := ustore.NewArena(nil)
fetched, err := ustore.NewArena(nil)
scanned, err := database.BlobsScan(people, 100, found, nil)
for _, key := range scanned.Keys(0) {
	values, err := database.BlobsRead(people, []ustore.Key{key}, fetched, nil) // rewinds fetched, never found
	consume(values, err)
}
```

### Receivers & Deferred Calls

The receiver a verb is called on chooses what it sees, where it runs and how it completes, while the verb and its arguments stay. A `Database`, a `Transaction`, a `Snapshot` and a cursor run their verbs on the calling goroutine, `On(executor)` blocks on an executor, and `Deferred(executor)`, which cursors lack, answers a `*Deferred` once the call is submitted, or the refusal the binding or the library made before anything ran. A deferred call reads its slices and writes its arena until it is final, so neither may change until `Wait` returns. `Wait` blocks in `ustore_outcome_wait`, `Status` polls through `ustore_outcome_status`, and a `Deferred` dropped without either is released by the collector once its call is final.

```go
deferred := database.Deferred(executor)
writing, err := deferred.BlobsWrite(people, []ustore.Key{ada, grace}, ustore.TapeOf("Ada", "Grace"), nil)
if err != nil {
	return err
}
_, err = writing.Wait()

reading, err := deferred.BlobsRead(people, []ustore.Key{ada, grace}, arena, nil)
values, err := reading.Wait() // or poll reading.Status() until it leaves ustore.StatusDeferred
committing, err := transaction.Deferred(executor).Commit(ustore.DurabilityBuffered)
```

### Executors

An `Executor` is the threads that run calls, shared by any number of databases and receivers, serving one call at a time, so a call submitted while another holds it answers `StatusContended`. `ExecutorForRam` spawns threads near the NUMA nodes it names, every node for an empty list, where zero threads take seven eighths of their cores, and a nonzero scratch limit caps each thread’s scratch. `ExecutorForNvme` spawns the NVMe engine’s rings near the memory domains it names or the media under its `Paths`, and `ExecutorForVram` drives the GPUs of one vendor, their positions in `GPUDevices` or every one for none, one stream each, which it creates and destroys or adopts from the caller and destroys. Opening a database blocks, on the executor its config names or the calling goroutine, and closing an executor waits for the call holding it. An arena never outlives the executor that made it, so `defer executor.Close()` comes before `defer arena.Close()`, and an arena from `NewArena(nil)` lives until it is closed.

```go
executor, err := ustore.ExecutorForRam([]int32{0}, 8, ustore.CPUClassUnknown, 0)
defer executor.Close()
people, err := ustore.DatabaseOpenRocksdb("/var/lib/people", &ustore.DatabaseOpenRocksdbConfig{Executor: executor})
arena, err := ustore.NewArena(executor)
defer arena.Close()
found, err := people.On(executor).CollectionFind(ustore.TapeOf("names"), arena)
err = executor.Drain(ustore.MoodParked)
```

### Apache Arrow

The converters of `c/ustore/arrow.h` view an Arrow column as a call’s input in place, and export what a call wrote into an arena as a column in place, and until the column is released the arena’s next call and `Close` answer `StatusContended`:

```go
scanned, err := database.BlobsScan(people, 100, found, nil)
var schema ustore.ArrowSchema
var array ustore.ArrowDeviceArray
if err := ustore.KeysViewToArrow(scanned.Keys(0), found, &schema, &array); err != nil {
	return err
}
defer schema.Release()
defer array.Release()

keys, err := ustore.KeysViewFromArrow(&schema, array.Array()) // the same keys, in place
columns, err := database.DocsGather(movies, keys, ustore.TapeOf("title"), []ustore.DocsFieldType{ustore.DocsFieldTypeString}, fetched)
var titles ustore.ArrowSchema
var column ustore.ArrowDeviceArray
err = ustore.DocsColumnViewToArrow(columns.Column(0), ustore.DocsFieldTypeString, fetched, &titles, &column)
defer titles.Release()
defer column.Release()

tape, err := ustore.StringsViewFromArrow(&titles, column.Array()) // the same strings, as a Tape
err = database.BlobsWrite(people, keys, tape, nil)
```

`KeysViewFromArrow` and `StringsViewFromArrow` read keys and strings, and `KeysViewToArrow`, `StringsViewToArrow` and `DocsColumnViewToArrow` write keys, strings and gathered columns.

## API

### Types

#### `PhaseProgress`

PhaseProgress is where a plan stands: its phase, that phase's position in the plan, and its own count, laid out as ustore_phase_progress_t.

[db.go:220 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L220)

```go
type PhaseProgress struct {
    Phase Phase
    Ordinal uint64
    Completed uint64
    Total uint64
}
```

#### Fields

| `Phase` | `Phase` | Phase is the kind of work in hand. |
| - | - | - |
| `Ordinal` | `uint64` | Ordinal is this phase's position among the ones the plan runs, from zero. |
| `Completed` | `uint64` | Completed counts the units of this phase done. |
| `Total` | `uint64` | Total counts the units of this phase in all. |

#### `ProgressCallback`

ProgressCallback is called with the units a long call finished so far and the units it finishes if it runs to the end; false stops it, which then fails with [StatusCancelled](https://www.unum.cloud/docs/ustore/go/errors.md#StatusCancelled) and publishes nothing.

[db.go:646 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L646)

```go
type ProgressCallback func(finished, total uint64) bool
```

It never runs on two threads at once, and it must not panic.

#### `Residency`

Residency is where an arena's outputs live.

[db.go:458 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L458)

```go
type Residency int32
```

#### Values

| `ResidencyUnknown` | | ResidencyUnknown is no residency, which only a zeroed description reads as. |
| - | - | - |
| `ResidencyRam` | | ResidencyRam is host pages, which Go code reads in place. |
| `ResidencyVram` | | ResidencyVram is one device's memory, which Go code reads only where its [HostAccess](#HostAccess) is [HostAccessReadable](#HostAccessReadable). |

#### Struct `Arena`

Arena is memory the library writes every output whose length scales with a call into, reused so a steady loop allocates once.3

[types.go:893 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L893)

```go
type Arena struct {
    // contains filtered or unexported fields
}
```

Every call given an arena rewinds and refills it, so the views of its previous call end there, as they do once it is closed: their accessors panic with [StatusContended](https://www.unum.cloud/docs/ustore/go/errors.md#StatusContended), as a slice bound does, while a slice already handed out is plain memory the next call overwrites, so it is valid only until then. To keep one call's views past the next, give that call another arena. An arena serves one call at a time, and a second overlapping it fails with [StatusContended](https://www.unum.cloud/docs/ustore/go/errors.md#StatusContended). Deferred verbs view it as blocking ones do, since Close waits for every deferred call naming it.

##### `NewArena`

NewArena makes an empty arena where executor computes, host pages or the memory of its GPU, decided once; a nil executor makes host pages for calls on the calling goroutine.

[types.go:902 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L902)

```go
func NewArena(executor *Executor) (*Arena, error)
```

Nothing is allocated until a call writes into it. An arena must not outlive the executor that made it, so [Arena.Close](#Close) comes before [Executor.Close](#Close); one made with a nil executor lives until it is closed.

##### `Close`

Close releases the memory, waiting for every deferred call naming the arena, and ends every view over it; it comes before the Close of the executor that made the arena.

[types.go:1281 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L1281)

```go
func (arena *Arena) Close() error
```

While an Arrow export of its outputs is unreleased it fails with [StatusContended](https://www.unum.cloud/docs/ustore/go/errors.md#StatusContended) and frees nothing, so a later Close retries. It is idempotent, and a closed arena must not be used again.

##### `Describe`

Describe reports where the arena's outputs live, as the executor that made it decided.

[types.go:954 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L954)

```go
func (arena *Arena) Describe() (ArenaDescription, error)
```

#### Struct `BlobsCursor`

BlobsCursor walks the keys of one collection page by page, every pull resuming past the last key the pull before it handed out.4

[blobs.go:397 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/blobs.go#L397)

```go
type BlobsCursor struct {
    BlobsCursorOn
    // contains filtered or unexported fields
}
```

It holds its database open, and the transaction or snapshot it reads through, until [BlobsCursor.Close](#Close).

##### `*Close`

× 5 Close frees the walk, giving back the holds it kept.

[blobs.go:497 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/blobs.go#L497)

```go
func (cursor *BlobsCursor) Close() error
```

It is idempotent.

##### `Next*NextKeys`

× 2 NextKeys pulls up to wanted keys of the walk into arena.

[blobs.go:453 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/blobs.go#L453)

Inherited from `BlobsCursorOn`

```go
func (on BlobsCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Page, error)
```

##### `Next*NextPairs`

× 2 NextPairs pulls up to wanted keys of the walk with their values into arena, in one call.

[blobs.go:464 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/blobs.go#L464)

Inherited from `BlobsCursorOn`

```go
func (on BlobsCursor) NextNextPairs(
    wanted uint,
    arena *Arena,
) (Page, error)
```

##### `*On`

× 12 On is the receiver whose pulls block on executor.

[blobs.go:410 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/blobs.go#L410)

Inherited from `BlobsCursorOn`

```go
func (on BlobsCursor) On(executor *Executor) BlobsCursorOn
```

#### Struct `BlobsCursorOn`

BlobsCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a [BlobsCursor](#BlobsCursor), and on an executor when [BlobsCursorOn.On](#On) makes it.

[blobs.go:405 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/blobs.go#L405)

```go
type BlobsCursorOn struct {
    // contains filtered or unexported fields
}
```

#### Enum `CPUClass`

CPUClass is the CPU generation a database or an executor confines itself to; the zero value sets no ceiling.2

[types.go:301 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L301)

```go
type CPUClass int32
```

#### Values

| `CPUClassUnknown` | | CPUClassUnknown picks the newest class this machine runs. |
| - | - | - |
| `CPUClassSerial` | | CPUClassSerial is the portable floor every CPU runs. |
| `CPUClassMonoversioned` | | CPUClassMonoversioned is the one class of a monoversioned build. |
| `CPUClassIntelHaswell` | | CPUClassIntelHaswell is x86 from Intel Haswell on. |
| `CPUClassIntelSierra` | | CPUClassIntelSierra is x86 efficiency cores from Intel Sierra Forest on. |
| `CPUClassIntelSkylake` | | CPUClassIntelSkylake is x86 server cores from Intel Skylake on. |
| `CPUClassIntelIcelake` | | CPUClassIntelIcelake is x86 server cores from Intel Ice Lake on. |
| `CPUClassAWSG2` | | CPUClassAWSG2 is Arm from AWS Graviton 2 on. |
| `CPUClassAppleM2` | | CPUClassAppleM2 is Arm from Apple M2 on. |
| `CPUClassAWSG5` | | CPUClassAWSG5 is Arm server cores from AWS Graviton 5 on. |
| `CPUClassAlibabaC930` | | CPUClassAlibabaC930 is RISC-V with RVV, Zawrs and Zacas, from Alibaba's C930 on. |
| `CPUClassIBMPower10` | | CPUClassIBMPower10 is Power from POWER10 on. |

##### `CPUClassFromName`

CPUClassFromName reads a CPU class back from the spelling [CPUClass.String](https://www.unum.cloud/docs/ustore/go/platform-notes.md#String) renders.

[types.go:336 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L336)

```go
func CPUClassFromName(name string) (CPUClass, error)
```

##### `String`

String renders the class as the library spells it, such as "intel-haswell".

[types.go:331 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L331)

```go
func (class CPUClass) String() string
```

#### Struct `ChangesCursor`

ChangesCursor is a feed of the changes committed to one collection after a stamp, oldest first, pinning that stamp as a snapshot does until [ChangesCursor.Close](#Close).3

[db.go:1810 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1810)

```go
type ChangesCursor struct {
    ChangesCursorOn
    // contains filtered or unexported fields
}
```

##### `Close`

Close releases the feed and the stamp it pins.

[db.go:1949 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1949)

```go
func (cursor *ChangesCursor) Close() error
```

It is idempotent.

##### `Next*NextKeys`

× 2 NextKeys pulls up to wanted changes into arena: their keys, stamps and kinds.

[db.go:1904 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1904)

Inherited from `ChangesCursorOn`

```go
func (on ChangesCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Changes, error)
```

##### `Next*NextPairs`

× 2 NextPairs pulls up to wanted changes into arena with the bytes every change carries.

[db.go:1915 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1915)

Inherited from `ChangesCursorOn`

```go
func (on ChangesCursor) NextNextPairs(
    wanted uint,
    arena *Arena,
) (Changes, error)
```

#### Struct `ChangesCursorOn`

ChangesCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a [ChangesCursor](#ChangesCursor), or on an executor that [ChangesCursorOn.On](#On) picks.

[db.go:1819 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1819)

```go
type ChangesCursorOn struct {
    // contains filtered or unexported fields
}
```

#### Struct `Database`

Database is an open database, safe to share across goroutines from open until [Database.Close](#Close).38

[db.go:748 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L748)

```go
type Database struct {
    DatabaseOn
    // contains filtered or unexported fields
}
```

Its own verbs read and write the head on the calling goroutine; [DatabaseOn.On](#On) and [DatabaseOn.Deferred](#Deferred) pick an executor.

##### `DatabaseInitRam`

DatabaseInitRam starts an empty database in memory alone.

[db.go:793 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L793)

```go
func DatabaseInitRam(
    config *DatabaseInitRamConfig,
) (*Database, error)
```

##### `DatabaseOpenLeveldb`

DatabaseOpenLeveldb serves a LevelDB directory in place, creating it if absent.

[db.go:935 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L935)

```go
func DatabaseOpenLeveldb(
    directory string,
    config *DatabaseOpenLeveldbConfig,
) (*Database, error)
```

##### `DatabaseOpenNvme`

DatabaseOpenNvme serves a directory through the in-tree NVMe engine.

[db.go:992 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L992)

```go
func DatabaseOpenNvme(
    directory string,
    config *DatabaseOpenNvmeConfig,
) (*Database, error)
```

##### `DatabaseOpenRam`

DatabaseOpenRam serves directory as one in-memory image, loading it if present.

[db.go:815 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L815)

```go
func DatabaseOpenRam(
    directory string,
    config *DatabaseInitRamConfig,
) (*Database, error)
```

##### `DatabaseOpenRocksdb`

DatabaseOpenRocksdb serves a RocksDB directory in place, creating it if absent.

[db.go:874 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L874)

```go
func DatabaseOpenRocksdb(
    directory string,
    config *DatabaseOpenRocksdbConfig,
) (*Database, error)
```

##### `DatabaseViewNvme`

DatabaseViewNvme serves the database a manifest names through the in-tree NVMe engine, read-only, writing nothing to its data directories and refusing every change with [StatusReadOnly](https://www.unum.cloud/docs/ustore/go/errors.md#StatusReadOnly).

[db.go:1050 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1050)

```go
func DatabaseViewNvme(
    directory string,
    config *DatabaseViewNvmeConfig,
) (*Database, error)
```

##### `DatabaseViewRocksdb`

DatabaseViewRocksdb serves a RocksDB directory read-only, refusing every change with [StatusReadOnly](https://www.unum.cloud/docs/ustore/go/errors.md#StatusReadOnly).

[db.go:899 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L899)

```go
func DatabaseViewRocksdb(
    directory string,
    config *DatabaseOpenRocksdbConfig,
) (*Database, error)
```

##### `Close`

Close releases the database once every transaction, snapshot, cursor and ingest holding it is closed, waiting for every deferred call naming it.

[db.go:767 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L767)

```go
func (database *Database) Close() error
```

It never flushes: commits made with [DurabilityBuffered](https://www.unum.cloud/docs/ustore/go/reads-and-writes.md#DurabilityBuffered) and not yet flushed are not on disk, so call [DatabaseOn.Flush](#Flush) first. It is idempotent, and a closed database must not be used again.

##### `Blobs*BlobsRemove`

× 4 BlobsRemove removes keys with their values, or every key of a range per task given end keys.

[db.go:202 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L202)

Inherited from `writes[Handle]`

```go
func (on Database) BlobsBlobsRemove(
    collections Collections,
    keys []Key,
    config *RemoveConfig,
) error
```

##### `Blobs*BlobsWrite`

× 4 BlobsWrite upserts one value per key, an empty value still being a value.

[db.go:162 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L162)

Inherited from `writes[Handle]`

```go
func (on Database) BlobsBlobsWrite(
    collections Collections,
    keys []Key,
    values Tape,
    config *WriteConfig,
) error
```

##### `ChangesCursor*ChangesCursorInit`

× 2 ChangesCursorInit opens a feed of collection's changes committed after since, reading nothing yet and blocking whatever receiver it is called on; every pull names its own executor through On.

[db.go:1831 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1831)

Inherited from `DatabaseOn`

```go
func (on Database) ChangesCursorChangesCursorInit(
    collection CollectionID,
    since CommitStamp,
) (*ChangesCursor, error)
```

##### `*Clear`

× 2 Clear empties every collection at once, as mode says, answering [StatusContended](https://www.unum.cloud/docs/ustore/go/errors.md#StatusContended) for a drop of the collections as [DatabaseOn.CollectionDrop](#CollectionDrop) does.

[db.go:1134 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1134)

Inherited from `DatabaseOn`

```go
func (on Database) Clear(mode DropMode) error
```

##### `Collection*CollectionCreate`

× 2 CollectionCreate creates a collection under name holding modality; a name starting with an underscore is refused, as the engines keep their own collections there.

[db.go:1380 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1380)

Inherited from `DatabaseOn`

```go
func (on Database) CollectionCollectionCreate(
    name string,
    modality Modality,
) (CollectionID, error)
```

##### `Collection*CollectionDrop`

× 2 CollectionDrop empties a collection of its pairs or values, or drops it whole, as mode says.

[db.go:1413 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1413)

Inherited from `DatabaseOn`

```go
func (on Database) CollectionCollectionDrop(
    collection CollectionID,
    mode DropMode,
) error
```

A whole drop answers [StatusContended](https://www.unum.cloud/docs/ustore/go/errors.md#StatusContended) while a snapshot is open, or on NVMe while a snapshot or a transaction is open.

##### `*Compact`

× 2 Compact reclaims the space that overwritten and removed data still takes, through the phases its engine runs.

[db.go:1182 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1182)

Inherited from `DatabaseOn`

```go
func (on Database) Compact(config *CompactConfig) error
```

##### `CompactPlan*CompactPlanFinish`

× 2 CompactPlanFinish frees a plan whatever the call answers, so another compaction may open on the database, leaving the plan fresh.

[db.go:1221 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1221)

Inherited from `DatabaseOn`

```go
func (on Database) CompactPlanCompactPlanFinish(plan *CompactPlan) error
```

##### `*Deferred`

× 4 Deferred is the receiver whose verbs submit their calls to executor.

[db.go:688 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L688)

Inherited from `DatabaseOn`

```go
func (on Database) Deferred(executor *Executor) DatabaseDeferredOn
```

##### `*Describe`

× 2 Describe reports the engine's capabilities, isolation, CPU class and the sizes it estimates.

[db.go:1104 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1104)

Inherited from `DatabaseOn`

```go
func (on Database) Describe() (DatabaseDescription, error)
```

##### `Docs*DocsRemove`

× 4 DocsRemove removes whole documents, or every document of a range per task given end keys.

[db.go:187 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L187)

Inherited from `writes[Handle]`

```go
func (on Database) DocsDocsRemove(
    collections Collections,
    keys []Key,
    config *RemoveConfig,
) error
```

##### `Docs*DocsWrite`

× 4 DocsWrite writes one document or field per value, keyed by keys or, without them, by the [DocsWriteConfig](https://www.unum.cloud/docs/ustore/go/documents.md#DocsWriteConfig) IDField of every document.

[db.go:142 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L142)

Inherited from `writes[Handle]`

```go
func (on Database) DocsDocsWrite(
    collections Collections,
    keys []Key,
    values Tape,
    config *DocsWriteConfig,
) error
```

##### `*Flush`

× 2 Flush makes every buffered write durable.

[db.go:1255 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1255)

Inherited from `DatabaseOn`

```go
func (on Database) Flush() error
```

##### `GraphRemove*GraphRemoveEdges`

× 4 GraphRemoveEdges removes edges, keeping their vertices.

[db.go:254 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L254)

Inherited from `writes[Handle]`

```go
func (on Database) GraphRemoveGraphRemoveEdges(
    collections Collections,
    edges []Edge,
    config *WriteConfig,
) error
```

##### `GraphRemove*GraphRemoveVertices`

× 4 GraphRemoveVertices removes vertices with every edge they connect to, or every vertex of a range per task given end vertices.

[db.go:351 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L351)

Inherited from `writes[Handle]`

```go
func (on Database) GraphRemoveGraphRemoveVertices(
    collections Collections,
    vertices []Key,
    config *GraphRemoveVerticesConfig,
) error
```

##### `GraphWrite*GraphWriteEdges`

× 4 GraphWriteEdges inserts edges, and their vertices where missing.

[db.go:212 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L212)

Inherited from `writes[Handle]`

```go
func (on Database) GraphWriteGraphWriteEdges(
    collections Collections,
    edges []Edge,
    config *WriteConfig,
) error
```

##### `GraphWrite*GraphWriteVertices`

× 4 GraphWriteVertices inserts vertices unless present.

[db.go:300 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L300)

Inherited from `writes[Handle]`

```go
func (on Database) GraphWriteGraphWriteVertices(
    collections Collections,
    vertices []Key,
    config *WriteConfig,
) error
```

##### `Ingest*IngestInit`

× 2 IngestInit opens an ingest into collection, whose rows arrive in order, blocking on the receiver's executor, whose memory domain holds the ingest.

[db.go:1985 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1985)

Inherited from `DatabaseOn`

```go
func (on Database) IngestIngestInit(
    collection CollectionID,
    order IngestOrder,
) (*Ingest, error)
```

##### `*On`

× 4 On is the receiver whose verbs block on executor.

[db.go:682 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L682)

Inherited from `DatabaseOn`

```go
func (on Database) On(executor *Executor) DatabaseOn
```

##### `Pages*PagesImport`

× 4 PagesImport replaces whole pages, one per key, with parsed markup.

[db.go:84 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L84)

Inherited from `writes[Handle]`

```go
func (on Database) PagesPagesImport(
    collections Collections,
    keys []Key,
    values Tape,
    config *PagesImportConfig,
) error
```

##### `Pages*PagesInsert`

× 4 PagesInsert parses one fragment per task into elements of the page keys names, reporting the key every element ended up with into arena.

[db.go:161 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L161)

Inherited from `writes[Handle]`

```go
func (on Database) PagesPagesInsert(
    collections Collections,
    keys []Key,
    values Tape,
    arena *Arena,
    config *PagesInsertConfig,
) (Inserted, error)
```

##### `Pages*PagesMove`

× 4 PagesMove moves elements with their subtrees under parents after anchors.

[db.go:273 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L273)

Inherited from `writes[Handle]`

```go
func (on Database) PagesPagesMove(
    collections Collections,
    keys, elements []Key,
    config *PagesMoveConfig,
) error
```

##### `Pages*PagesRemove`

× 4 PagesRemove removes elements with their subtrees, or whole pages of a range per task given end keys.

[db.go:220 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L220)

Inherited from `writes[Handle]`

```go
func (on Database) PagesPagesRemove(
    collections Collections,
    keys []Key,
    config *PagesRemoveConfig,
) error
```

##### `PagesRemove*PagesRemoveAttributes`

× 4 PagesRemoveAttributes removes one attribute of an element per task.

[db.go:401 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L401)

Inherited from `writes[Handle]`

```go
func (on Database) PagesRemovePagesRemoveAttributes(
    collections Collections,
    keys, elements []Key,
    fields Tape,
    config *WriteConfig,
) error
```

##### `PagesSet*PagesSetAttributes`

× 4 PagesSetAttributes sets one attribute of an element per task.

[db.go:359 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L359)

Inherited from `writes[Handle]`

```go
func (on Database) PagesSetPagesSetAttributes(
    collections Collections,
    keys, elements []Key,
    fields, values Tape,
    config *WriteConfig,
) error
```

##### `Pages*PagesSplice`

× 4 PagesSplice replaces textLengths bytes of the text of every element from textStarts with values, where a zero length only inserts and an empty value only removes.

[db.go:316 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L316)

Inherited from `writes[Handle]`

```go
func (on Database) PagesPagesSplice(
    collections Collections,
    keys, elements []Key,
    textStarts, textLengths []uint64,
    values Tape,
    config *WriteConfig,
) error
```

##### `Snapshot*SnapshotInit`

× 2 SnapshotInit pins the head as it stands, blocking whatever receiver it is called on.

[db.go:1302 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1302)

Inherited from `DatabaseOn`

```go
func (on Database) SnapshotSnapshotInit() (*Snapshot, error)
```

##### `Strings*StringsRemove`

× 4 StringsRemove removes strings with the keys they map onto, or every string of a range per task given end strings.

[db.go:84 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L84)

Inherited from `writes[Handle]`

```go
func (on Database) StringsStringsRemove(
    collections Collections,
    strings Tape,
    config *StringsRemoveConfig,
) error
```

##### `Strings*StringsWrite`

× 4 StringsWrite maps every string onto one key, its value.

[db.go:33 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L33)

Inherited from `writes[Handle]`

```go
func (on Database) StringsStringsWrite(
    collections Collections,
    strings Tape,
    values []Key,
    config *WriteConfig,
) error
```

##### `Transaction*TransactionInit`

× 2 TransactionInit begins a transaction on the head, blocking whatever receiver it is called on.

[db.go:1587 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1587)

Inherited from `DatabaseOn`

```go
func (on Database) TransactionTransactionInit() (*Transaction, error)
```

#### Struct `DatabaseOn`

DatabaseOn is the receiver whose verbs block until their call is final, reading and writing the head: on the calling goroutine when embedded in a [Database](#Database), and on an executor when [DatabaseOn.On](#On) makes it.

[db.go:668 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L668)

```go
type DatabaseOn struct {
    // contains filtered or unexported fields
}
```

#### Struct `Deferred`

Deferred is a submitted call, which holds its outcome and inputs until it is final, owned by the one goroutine that polls or waits on it.3

[types.go:1123 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L1123)

```go
type Deferred[Result any] struct {
    // contains filtered or unexported fields
}
```

Status polls without blocking, Wait blocks until the call is final and hands back its result, and Close waits the same way and drops it. A Deferred dropped without Wait or Close is released by the collector once the call is final, never blocking on it: until then every later collection checks it again.

##### `Close`

Close blocks until the call is final, releases its pins, and reports the call's failure.

[types.go:1160 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L1160)

```go
func (deferred *Deferred[Result]) Close() error
```

It is idempotent and safe after Wait.

##### `Status`

Status reports StatusDeferred until the call is final, then its final status, without blocking.

[types.go:1149 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L1149)

```go
func (deferred *Deferred[Result]) Status() Status
```

##### `Wait`

Wait blocks until the call is final, releases its pins, then hands back its result, the same every time it is asked.

[types.go:1153 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L1153)

```go
func (deferred *Deferred[Result]) Wait() (Result, error)
```

#### Struct `DocsCursor`

DocsCursor walks the documents of one collection in batches of rows, every pull resuming past the last key the pull before it handed out.1

[docs.go:566 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/docs.go#L566)

```go
type DocsCursor struct {
    DocsCursorOn
    // contains filtered or unexported fields
}
```

##### `*Next`

× 2 Next pulls batches of up to wanted rows in all into arena, each row a key and a cell of every column the cursor gathers.

[docs.go:661 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/docs.go#L661)

Inherited from `DocsCursorOn`

```go
func (on DocsCursor) Next(
    wanted uint,
    arena *Arena,
) (DocsBatches, error)
```

#### Struct `DocsCursorOn`

DocsCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a [DocsCursor](#DocsCursor), and on an executor when [DocsCursorOn.On](#On) makes it.

[docs.go:574 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/docs.go#L574)

```go
type DocsCursorOn struct {
    // contains filtered or unexported fields
}
```

#### Struct `Executor`

Executor owns the host threads, I/O rings or device stream calls run on, shared by any number of databases.5

[types.go:681 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L681)

```go
type Executor struct {
    // contains filtered or unexported fields
}
```

A nil \*Executor is the null executor: it owns nothing, and every call handed it runs on the calling goroutine. An executor serves one call at a time, while databases stay freely concurrent; a second call finding it held finishes [StatusContended](https://www.unum.cloud/docs/ustore/go/errors.md#StatusContended), and nothing queues.

##### `ExecutorForNvme`

ExecutorForNvme spawns threads for the NVMe engine, each submitting and polling its own I/O ring, placed with their staging on memoryDomains, the first placing the threads, or on the domain nvme.Paths share for an empty list.

[types.go:730 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L730)

```go
func ExecutorForNvme(
    memoryDomains []int32,
    nvme NvmeOptions,
    threads uint,
    cpuClassCeiling CPUClass,
    scratchLimit uint64,
) (*Executor, error)
```

Zero threads takes the fewest hardware queues of the disks under the paths, capped by the cores, and a zero scratchLimit takes 16 GiB per thread.

##### `ExecutorForRam`

ExecutorForRam spawns host threads for the RAM, RocksDB and LevelDB engines, interleaved across the compute domains local to memoryDomains, every domain the process may allocate on for an empty list.

[types.go:690 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L690)

```go
func ExecutorForRam(
    memoryDomains []int32,
    threads uint,
    cpuClassCeiling CPUClass,
    scratchLimit uint64,
) (*Executor, error)
```

Zero threads takes seven eighths of the cores those domains carry, and a cpuClassCeiling the CPU lacks narrows the pick rather than refusing it. Every call's staging carves from each thread's scratch, capped at scratchLimit, where zero takes 16 GiB.

##### `ExecutorForVram`

ExecutorForVram opens one non-blocking stream on every named device, its position in the listing of [GPUDevices](#GPUDevices), all of one vendor, created with the executor and destroyed when it closes, all of them driven by the one goroutine that calls the verbs, so that a deferred call on it is final once it returns.

[types.go:771 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L771)

```go
func ExecutorForVram(
    devices []int32,
    gpuClassCeiling GPUClass,
    streams []unsafe.Pointer,
    scratchLimit uint64,
    gds Gds,
) (*Executor, error)
```

Empty devices take every listed device of the first vendor with a known class. Arenas live on the first device, where every call computes but a filtered scan, which deals its pages across every device.

Streams are empty, or one per device in devices order, a cudaStream_t, hipStream_t or id\<MTLCommandQueue> on that device, which the executor adopts: on success a CUDA or HIP stream becomes the executor's, which synchronizes and destroys it when it closes, while a Metal queue is retained, the executor releasing its own reference and the caller keeping theirs; on failure every stream stays the caller's. A nil or default stream, a device named twice beside streams, or streams beside empty devices answer [StatusInvalidArgument](https://www.unum.cloud/docs/ustore/go/errors.md#StatusInvalidArgument), and a stream on another device than its entry names answers [StatusConfigMismatch](https://www.unum.cloud/docs/ustore/go/errors.md#StatusConfigMismatch). Zero scratchLimit lets each device's scratch grow, gds is how reads and compactions move bytes between the drives and the devices, and a gpuClassCeiling some named device loads nothing under answers [StatusUnsupported](https://www.unum.cloud/docs/ustore/go/errors.md#StatusUnsupported).

##### `Close`

Close waits out the call holding the executor, then releases its threads, rings or streams; every arena it made must be closed first, or it fails with [StatusContended](https://www.unum.cloud/docs/ustore/go/errors.md#StatusContended) and frees nothing, so a later Close retries.

[types.go:1210 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L1210)

```go
func (executor *Executor) Close() error
```

It is idempotent; a closed executor must not be used again.

##### `Drain`

Drain waits until no call holds the executor, then adopts mood until its next call; it only waits and never runs a call itself.

[types.go:803 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L803)

```go
func (executor *Executor) Drain(mood Mood) error
```

A failure is the executor's own, never one of a drained call.

#### Enum `GPUClass`

GPUClass is a GPU generation UStore tells apart; a class implies its vendor, and the zero value sets no ceiling.2

[types.go:416 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L416)

```go
type GPUClass int32
```

#### Values

| `GPUClassUnknown` | | GPUClassUnknown is no class. |
| - | - | - |
| `GPUClassNVIDIAAmpere` | | GPUClassNVIDIAAmpere is Ampere-class NVIDIA, and every later GPU that compiles its PTX. |
| `GPUClassNVIDIAAda` | | GPUClassNVIDIAAda is Ada-class NVIDIA. |
| `GPUClassNVIDIAHopper` | | GPUClassNVIDIAHopper is Hopper-class NVIDIA. |
| `GPUClassNVIDIABlackwell` | | GPUClassNVIDIABlackwell is Blackwell-class NVIDIA. |
| `GPUClassNVIDIABlackwellRTX` | | GPUClassNVIDIABlackwellRTX is consumer Blackwell NVIDIA. |
| `GPUClassAMDCDNA3` | | GPUClassAMDCDNA3 is CDNA3 AMD, gfx942. |
| `GPUClassAMDCDNA4` | | GPUClassAMDCDNA4 is CDNA4 AMD, gfx950. |
| `GPUClassAMDCDNA5` | | GPUClassAMDCDNA5 is CDNA5 AMD, gfx1250. |
| `GPUClassAppleMetal7` | | GPUClassAppleMetal7 is Apple7-family GPUs, and every Apple GPU without a class of its own. |
| `GPUClassAppleMetal9` | | GPUClassAppleMetal9 is Apple9-family GPUs. |
| `GPUClassAppleMetal10` | | GPUClassAppleMetal10 is Apple10-family GPUs. |

##### `GPUClassFromName`

GPUClassFromName reads a GPU class back from the spelling [GPUClass.String](https://www.unum.cloud/docs/ustore/go/platform-notes.md#String) renders.

[types.go:451 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L451)

```go
func GPUClassFromName(name string) (GPUClass, error)
```

##### `String`

String renders the class as the library spells it, such as "amd-cdna3".

[types.go:446 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L446)

```go
func (class GPUClass) String() string
```

#### Struct `GPUDevice`

GPUDevice is one GPU as UStore numbers it: its position in [GPUDevices](#GPUDevices) is the ordinal [ExecutorForVram](#ExecutorForVram) names it by.1

[types.go:822 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L822)

```go
type GPUDevice struct {
    Vendor GPUVendor
    VendorOrdinal uint32
    GPUClass GPUClass
    ComputeUnits uint32
    MemoryBytes uint64
    Name string
}
```

#### Fields

| `Vendor` | `GPUVendor` | Vendor is the vendor whose runtime drives the device. |
| - | - | - |
| `VendorOrdinal` | `uint32` | VendorOrdinal is the device's ordinal in its vendor's runtime. |
| `GPUClass` | `GPUClass` | GPUClass is the newest class this build compiled code for that runs on the device. |
| `ComputeUnits` | `uint32` | ComputeUnits counts streaming multiprocessors, compute units or GPU cores. |
| `MemoryBytes` | `uint64` | MemoryBytes is the device memory, or the working set Metal recommends for unified memory. |
| `Name` | `string` | Name is the vendor's own name for the device. |

##### `GPUDevices`

GPUDevices lists every GPU this process can drive, NVIDIA devices first, then AMD, then Apple, and nothing on a machine without GPUs.

[types.go:839 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L839)

```go
func GPUDevices() ([]GPUDevice, error)
```

#### Enum `GPUVendor`

GPUVendor is a GPU vendor one binary drives, each through a runtime opened on first use.1

[types.go:396 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L396)

```go
type GPUVendor int32
```

#### Values

| `GPUVendorUnknown` | | GPUVendorUnknown names no vendor. |
| - | - | - |
| `GPUVendorNVIDIA` | | GPUVendorNVIDIA drives NVIDIA devices through the CUDA driver. |
| `GPUVendorAMD` | | GPUVendorAMD drives AMD devices through the HIP runtime. |
| `GPUVendorApple` | | GPUVendorApple drives Apple devices through Metal. |

##### `String`

String renders the vendor as the library spells it.

[types.go:410 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L410)

```go
func (vendor GPUVendor) String() string
```

#### Enum `Gds`

Gds is how a VRAM executor moves bytes through GPUDirect Storage, between the drives and its device.2

[types.go:373 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L373)

```go
type Gds int32
```

#### Values

| `GdsAutomatic` | | GdsAutomatic transfers directly where the driver is loaded, and through cuFile's compatibility mode elsewhere. |
| - | - | - |
| `GdsDirect` | | GdsDirect transfers directly, refused with [StatusDevice](https://www.unum.cloud/docs/ustore/go/errors.md#StatusDevice) where the driver is absent. |
| `GdsCompatibility` | | GdsCompatibility bounces through host pages cuFile manages. |

##### `GdsFromName`

GdsFromName reads a GPUDirect Storage mode back from the spelling [Gds.String](https://www.unum.cloud/docs/ustore/go/platform-notes.md#String) renders.

[types.go:389 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L389)

```go
func GdsFromName(name string) (Gds, error)
```

##### `String`

String renders the mode as the library spells it.

[types.go:386 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L386)

```go
func (gds Gds) String() string
```

#### Struct `GraphVerticesCursor`

GraphVerticesCursor walks the vertices of one graph collection page by page, every pull resuming past the last vertex the pull before it handed out.1

[graph.go:479 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/graph.go#L479)

```go
type GraphVerticesCursor struct {
    GraphVerticesCursorOn
    // contains filtered or unexported fields
}
```

##### `Next*NextKeys`

× 2 NextKeys pulls up to wanted vertices of the walk into arena.

[graph.go:532 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/graph.go#L532)

Inherited from `GraphVerticesCursorOn`

```go
func (on GraphVerticesCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Page, error)
```

#### Struct `GraphVerticesCursorOn`

GraphVerticesCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a [GraphVerticesCursor](#GraphVerticesCursor), or on an executor when [GraphVerticesCursorOn.On](#On) makes it.

[graph.go:488 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/graph.go#L488)

```go
type GraphVerticesCursorOn struct {
    // contains filtered or unexported fields
}
```

#### Enum `HostAccess`

HostAccess is whether Go code may read an arena's outputs, which every verb checks before it views them as Go slices.1

[types.go:472 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L472)

```go
type HostAccess int32
```

#### Values

| `HostAccessRefused` | | HostAccessRefused is memory host code must not read. |
| - | - | - |
| `HostAccessReadable` | | HostAccessReadable is host, pinned, managed and Apple's shared memory, read in place. |

##### `String`

String renders the host access as the library spells it.

[types.go:482 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L482)

```go
func (access HostAccess) String() string
```

#### Struct `Ingest`

Ingest lands every row appended to it into one collection as one commit of its own, joining no transaction; its calls run one at a time, on the calling goroutine, or on an executor through [IngestOn.On](#On).4

[db.go:1966 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1966)

```go
type Ingest struct {
    IngestOn
    // contains filtered or unexported fields
}
```

##### `Close`

Close frees the ingest, dropping every row of an unfinished one.

[db.go:2080 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L2080)

```go
func (ingest *Ingest) Close() error
```

It is idempotent.

##### `*Append`

× 2 Append hands the ingest one batch of rows, copied or written before it returns, parsing values over the executor's threads.

[db.go:2030 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L2030)

Inherited from `IngestOn`

```go
func (on Ingest) Append(rows IngestRows) error
```

##### `*Finish`

× 2 Finish lands every row appended as one commit and ends the ingest, answering the one stamp every row landed at.

[db.go:2060 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L2060)

Inherited from `IngestOn`

```go
func (on Ingest) Finish(
    durability Durability,
) (CommitStamp, error)
```

##### `*On`

× 2 On is the receiver whose calls block on executor.

[db.go:1978 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1978)

Inherited from `IngestOn`

```go
func (on Ingest) On(executor *Executor) IngestOn
```

#### Struct `IngestOn`

IngestOn is the receiver whose appends and finish block until their call is final: on the calling goroutine when embedded in an [Ingest](#Ingest), and on an executor when [IngestOn.On](#On) makes it.

[db.go:1973 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1973)

```go
type IngestOn struct {
    // contains filtered or unexported fields
}
```

#### Enum `Mood`

Mood is what an executor's threads do between a drain and its next call.2

[types.go:280 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L280)

```go
type Mood int32
```

#### Values

| `MoodParked` | | MoodParked sleeps in the kernel until the next call, freeing the cores. |
| - | - | - |
| `MoodSpinning` | | MoodSpinning keeps polling, trading the cores for the lowest wake-up latency. |

##### `MoodFromName`

MoodFromName reads a mood back from the spelling [Mood.String](https://www.unum.cloud/docs/ustore/go/platform-notes.md#String) renders.

[types.go:293 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L293)

```go
func MoodFromName(name string) (Mood, error)
```

##### `String`

String renders the mood as the library spells it.

[types.go:290 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L290)

```go
func (mood Mood) String() string
```

#### Struct `PagesCursor`

PagesCursor walks the pages of one collection page by page, every pull resuming past the last key the pull before it handed out.2

[pages.go:590 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/pages.go#L590)

```go
type PagesCursor struct {
    PagesCursorOn
    // contains filtered or unexported fields
}
```

##### `Next*NextKeys`

× 2 NextKeys pulls up to wanted page keys of the walk into arena.

[pages.go:643 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/pages.go#L643)

Inherited from `PagesCursorOn`

```go
func (on PagesCursor) NextNextKeys(
    wanted uint,
    arena *Arena,
) (Page, error)
```

##### `Next*NextPairs`

× 2 NextPairs pulls up to wanted page keys of the walk with their pages rendered as outputsEncoding into arena.

[pages.go:655 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/pages.go#L655)

Inherited from `PagesCursorOn`

```go
func (on PagesCursor) NextNextPairs(
    wanted uint,
    outputsEncoding PageEncoding,
    arena *Arena,
) (Page, error)
```

#### Struct `PagesCursorOn`

PagesCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a [PagesCursor](#PagesCursor), and on an executor when [PagesCursorOn.On](#On) makes it.

[pages.go:598 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/pages.go#L598)

```go
type PagesCursorOn struct {
    // contains filtered or unexported fields
}
```

#### Struct `Snapshot`

Snapshot pins the state it was taken at until [Snapshot.Close](#Close), and its own verbs read that state on the calling goroutine; nothing writes through it.32

[db.go:1289 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1289)

```go
type Snapshot struct {
    SnapshotOn
    // contains filtered or unexported fields
}
```

##### `Close`

Close releases the snapshot once every deferred call naming it is final, unpinning the versions only it kept.

[db.go:1331 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1331)

```go
func (snapshot *Snapshot) Close() error
```

It is idempotent.

##### `ReadStamp`

ReadStamp reports the stamp the snapshot reads at, which every commit at or below it shows.

[db.go:1327 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1327)

```go
func (snapshot *Snapshot) ReadStamp() ReadStamp
```

##### `BlobsCursor*BlobsCursorInit`

× 2 BlobsCursorInit opens a walk over collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on; every pull names its own executor through On.

[db.go:417 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L417)

Inherited from `reads[Handle]`

```go
func (on Snapshot) BlobsCursorBlobsCursorInit(
    collection CollectionID,
    startKey Key,
    config *BlobsCursorConfig,
) (*BlobsCursor, error)
```

##### `Blobs*BlobsMeasure`

× 2 BlobsMeasure estimates the entries and the space inside a range per task into arena, one task per collection collections names, without walking them.

[db.go:552 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L552)

Inherited from `reads[Handle]`

```go
func (on Snapshot) BlobsBlobsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
```

##### `Blobs*BlobsRead`

× 2 BlobsRead reads one value per key into arena, a missing key reading as absent.

[db.go:255 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L255)

Inherited from `reads[Handle]`

```go
func (on Snapshot) BlobsBlobsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *BlobsReadConfig,
) (Values, error)
```

##### `Blobs*BlobsSample`

× 2 BlobsSample draws up to wanted keys uniformly at random into arena, one task per collection collections names.

[db.go:513 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L513)

Inherited from `reads[Handle]`

```go
func (on Snapshot) BlobsBlobsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
```

##### `Blobs*BlobsScan`

× 2 BlobsScan lists up to wanted keys of a range per task into arena, one task per collection collections names.

[db.go:322 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L322)

Inherited from `reads[Handle]`

```go
func (on Snapshot) BlobsBlobsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *BlobsScanConfig,
) (Scanned, error)
```

##### `Collection*CollectionFind`

× 2 CollectionFind resolves a batch of names into the collections they address, into arena.

[db.go:1537 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1537)

Inherited from `reads[Handle]`

```go
func (on Snapshot) CollectionCollectionFind(
    names Tape,
    arena *Arena,
) (FoundCollections, error)
```

##### `Collection*CollectionList`

× 2 CollectionList lists every collection the receiver sees, with its modality and name, into arena.

[db.go:1478 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1478)

Inherited from `reads[Handle]`

```go
func (on Snapshot) CollectionCollectionList(
    arena *Arena,
) (CollectionList, error)
```

##### `DocsCursor*DocsCursorInit`

× 2 DocsCursorInit opens a walk over collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on.

[db.go:587 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L587)

Inherited from `reads[Handle]`

```go
func (on Snapshot) DocsCursorDocsCursorInit(
    collection CollectionID,
    startKey Key,
    config *DocsCursorConfig,
) (*DocsCursor, error)
```

##### `Docs*DocsGather`

× 2 DocsGather reads, type-checks and converts one column per field of the documents keys name into arena, converting field i into outputsTypes\[i].

[db.go:424 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L424)

Inherited from `reads[Handle]`

```go
func (on Snapshot) DocsDocsGather(
    collections Collections,
    keys []Key,
    fields Tape,
    outputsTypes []DocsFieldType,
    arena *Arena,
) (Columns, error)
```

##### `Docs*DocsGist`

× 2 DocsGist lists the unique paths to the leaves of the documents keys name into arena.

[db.go:301 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L301)

Inherited from `reads[Handle]`

```go
func (on Snapshot) DocsDocsGist(
    collections Collections,
    keys []Key,
    arena *Arena,
) (Paths, error)
```

##### `Docs*DocsMeasure`

× 2 DocsMeasure estimates the documents and the space inside a range per task into arena, one task per collection collections names.

[db.go:740 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L740)

Inherited from `reads[Handle]`

```go
func (on Snapshot) DocsDocsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
```

##### `Docs*DocsRead`

× 2 DocsRead reads whole documents or fields inside them into arena, a missing one reading as absent.

[db.go:240 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L240)

Inherited from `reads[Handle]`

```go
func (on Snapshot) DocsDocsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *DocsReadConfig,
) (Values, error)
```

##### `Docs*DocsSample`

× 2 DocsSample draws up to wanted document keys uniformly at random into arena, one task per collection collections names.

[db.go:701 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L701)

Inherited from `reads[Handle]`

```go
func (on Snapshot) DocsDocsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
```

##### `Docs*DocsScan`

× 2 DocsScan lists up to wanted document keys of a range per task into arena, one task per collection collections names.

[db.go:493 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L493)

Inherited from `reads[Handle]`

```go
func (on Snapshot) DocsDocsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *DocsScanConfig,
) (Scanned, error)
```

##### `GraphMeasure*GraphMeasureVertices`

× 2 GraphMeasureVertices estimates the vertices and the space inside a range per task into arena, one task per collection collections names.

[db.go:609 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L609)

Inherited from `reads[Handle]`

```go
func (on Snapshot) GraphMeasureGraphMeasureVertices(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
```

##### `GraphRead*GraphReadEdges`

× 2 GraphReadEdges reads the degree and the edges of every vertex in its roles into arena.

[db.go:170 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L170)

Inherited from `reads[Handle]`

```go
func (on Snapshot) GraphReadGraphReadEdges(
    collections Collections,
    vertices []Key,
    roles Roles,
    arena *Arena,
) (Neighborhoods, error)
```

##### `GraphSample*GraphSampleVertices`

× 2 GraphSampleVertices draws up to wanted vertices uniformly at random into arena, one task per collection collections names.

[db.go:570 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L570)

Inherited from `reads[Handle]`

```go
func (on Snapshot) GraphSampleGraphSampleVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
```

##### `GraphScan*GraphScanVertices`

× 2 GraphScanVertices lists up to wanted vertices of a range per task into arena, one task per collection collections names.

[db.go:414 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L414)

Inherited from `reads[Handle]`

```go
func (on Snapshot) GraphScanGraphScanVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *GraphScanConfig,
) (Scanned, error)
```

##### `GraphVerticesCursor*GraphVerticesCursorInit`

× 2 GraphVerticesCursorInit opens a walk over the vertices of collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on.

[db.go:500 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L500)

Inherited from `reads[Handle]`

```go
func (on Snapshot) GraphVerticesCursorGraphVerticesCursorInit(
    collection CollectionID,
    startKey Key,
    config *GraphVerticesCursorConfig,
) (*GraphVerticesCursor, error)
```

##### `PagesCursor*PagesCursorInit`

× 2 PagesCursorInit opens a walk over collection from startKey, reading nothing until its first pull and blocking whatever receiver it is called on.

[db.go:610 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L610)

Inherited from `reads[Handle]`

```go
func (on Snapshot) PagesCursorPagesCursorInit(
    collection CollectionID,
    startKey Key,
    config *PagesCursorConfig,
) (*PagesCursor, error)
```

##### `Pages*PagesMeasure`

× 2 PagesMeasure estimates the pages and the space inside a range per task into arena, one task per collection collections names.

[db.go:744 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L744)

Inherited from `reads[Handle]`

```go
func (on Snapshot) PagesPagesMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (Measurement, error)
```

##### `Pages*PagesRead`

× 2 PagesRead renders whole pages or subtrees into arena, a missing one reading as absent.

[db.go:455 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L455)

Inherited from `reads[Handle]`

```go
func (on Snapshot) PagesPagesRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *PagesReadConfig,
) (Values, error)
```

##### `Pages*PagesSample`

× 2 PagesSample draws up to wanted page keys uniformly at random into arena, one task per collection collections names.

[db.go:705 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L705)

Inherited from `reads[Handle]`

```go
func (on Snapshot) PagesPagesSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Scanned, error)
```

##### `Pages*PagesScan`

× 2 PagesScan lists up to wanted page keys of a range per task into arena, one task per collection collections names.

[db.go:522 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L522)

Inherited from `reads[Handle]`

```go
func (on Snapshot) PagesPagesScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *PagesScanConfig,
) (Scanned, error)
```

##### `*Save`

× 2 Save writes the snapshot out as a new database of the same engine at path, holding exactly the collections and names it records; a cancelled save removes what it wrote.

[db.go:1342 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1342)

Inherited from `SnapshotOn`

```go
func (on Snapshot) Save(
    path string,
    progress ProgressCallback,
) error
```

##### `StringsCursor*StringsCursorInit`

× 2 StringsCursorInit opens a walk over collection, copying its prefix and bounds, reading nothing until its first pull and blocking whatever receiver it is called on.

[db.go:358 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L358)

Inherited from `reads[Handle]`

```go
func (on Snapshot) StringsCursorStringsCursorInit(
    collection CollectionID,
    config *StringsCursorConfig,
) (*StringsCursor, error)
```

##### `Strings*StringsMeasure`

× 2 StringsMeasure estimates the entries and the space inside a range of strings per task into arena, one task per collection collections names.

[db.go:532 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L532)

Inherited from `reads[Handle]`

```go
func (on Snapshot) StringsStringsMeasure(
    collections Collections,
    arena *Arena,
    config *StringsMeasureConfig,
) (Measurement, error)
```

##### `Strings*StringsRead`

× 2 StringsRead looks up the key every string maps onto into arena.

[db.go:151 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L151)

Inherited from `reads[Handle]`

```go
func (on Snapshot) StringsStringsRead(
    collections Collections,
    strings Tape,
    arena *Arena,
) (Mapped, error)
```

##### `Strings*StringsSample`

× 2 StringsSample draws up to wanted strings uniformly at random into arena, one task per collection collections names.

[db.go:482 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L482)

Inherited from `reads[Handle]`

```go
func (on Snapshot) StringsStringsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (Listing, error)
```

##### `Strings*StringsScan`

× 2 StringsScan lists up to wanted strings per task into arena, one task per collection collections names.

[db.go:257 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L257)

Inherited from `reads[Handle]`

```go
func (on Snapshot) StringsStringsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *StringsScanConfig,
) (Listing, error)
```

#### Struct `SnapshotDeferredOn`

SnapshotDeferredOn is the receiver whose verbs submit their calls to an executor, offering the verbs of [SnapshotOn](#SnapshotOn) with the same arguments.25

[db.go:725 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L725)

```go
type SnapshotDeferredOn struct {
    // contains filtered or unexported fields
}
```

##### `Save`

Save submits [SnapshotOn.Save](#Save).

[db.go:1349 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1349)

```go
func (on SnapshotDeferredOn) Save(
    path string,
    progress ProgressCallback,
) (*Deferred[struct{}], error)
```

##### `BlobsMeasure`

BlobsMeasure submits [DatabaseOn.BlobsMeasure](#BlobsMeasure).

[db.go:558 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L558)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) BlobsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
```

##### `BlobsRead`

BlobsRead submits [DatabaseOn.BlobsRead](#BlobsRead).

[db.go:261 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L261)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) BlobsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *BlobsReadConfig,
) (*Deferred[Values], error)
```

##### `BlobsSample`

BlobsSample submits [DatabaseOn.BlobsSample](#BlobsSample).

[db.go:519 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L519)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) BlobsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
```

##### `BlobsScan`

BlobsScan submits [DatabaseOn.BlobsScan](#BlobsScan).

[db.go:328 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L328)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) BlobsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *BlobsScanConfig,
) (*Deferred[Scanned], error)
```

##### `CollectionFind`

CollectionFind submits [DatabaseOn.CollectionFind](#CollectionFind).

[db.go:1543 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1543)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) CollectionFind(
    names Tape,
    arena *Arena,
) (*Deferred[FoundCollections], error)
```

##### `CollectionList`

CollectionList submits [DatabaseOn.CollectionList](#CollectionList).

[db.go:1484 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1484)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) CollectionList(
    arena *Arena,
) (*Deferred[CollectionList], error)
```

##### `DocsGather`

DocsGather submits [DatabaseOn.DocsGather](#DocsGather).

[db.go:430 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L430)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) DocsGather(
    collections Collections,
    keys []Key,
    fields Tape,
    outputsTypes []DocsFieldType,
    arena *Arena,
) (*Deferred[Columns], error)
```

##### `DocsGist`

DocsGist submits [DatabaseOn.DocsGist](#DocsGist).

[db.go:307 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L307)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) DocsGist(
    collections Collections,
    keys []Key,
    arena *Arena,
) (*Deferred[Paths], error)
```

##### `DocsMeasure`

DocsMeasure submits [DatabaseOn.DocsMeasure](#DocsMeasure).

[db.go:746 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L746)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) DocsMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
```

##### `DocsRead`

DocsRead submits [DatabaseOn.DocsRead](#DocsRead).

[db.go:246 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L246)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) DocsRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *DocsReadConfig,
) (*Deferred[Values], error)
```

##### `DocsSample`

DocsSample submits [DatabaseOn.DocsSample](#DocsSample).

[db.go:707 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L707)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) DocsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
```

##### `DocsScan`

DocsScan submits [DatabaseOn.DocsScan](#DocsScan).

[db.go:499 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L499)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) DocsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *DocsScanConfig,
) (*Deferred[Scanned], error)
```

##### `GraphMeasureVertices`

GraphMeasureVertices submits [DatabaseOn.GraphMeasureVertices](#GraphMeasureVertices).

[db.go:615 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L615)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) GraphMeasureVertices(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
```

##### `GraphReadEdges`

GraphReadEdges submits [DatabaseOn.GraphReadEdges](#GraphReadEdges).

[db.go:176 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L176)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) GraphReadEdges(
    collections Collections,
    vertices []Key,
    roles Roles,
    arena *Arena,
) (*Deferred[Neighborhoods], error)
```

##### `GraphSampleVertices`

GraphSampleVertices submits [DatabaseOn.GraphSampleVertices](#GraphSampleVertices).

[db.go:576 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L576)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) GraphSampleVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
```

##### `GraphScanVertices`

GraphScanVertices submits [DatabaseOn.GraphScanVertices](#GraphScanVertices).

[db.go:420 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L420)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) GraphScanVertices(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *GraphScanConfig,
) (*Deferred[Scanned], error)
```

##### `PagesMeasure`

PagesMeasure submits [DatabaseOn.PagesMeasure](#PagesMeasure).

[db.go:750 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L750)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) PagesMeasure(
    collections Collections,
    arena *Arena,
    config *MeasureConfig,
) (*Deferred[Measurement], error)
```

##### `PagesRead`

PagesRead submits [DatabaseOn.PagesRead](#PagesRead).

[db.go:461 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L461)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) PagesRead(
    collections Collections,
    keys []Key,
    arena *Arena,
    config *PagesReadConfig,
) (*Deferred[Values], error)
```

##### `PagesSample`

PagesSample submits [DatabaseOn.PagesSample](#PagesSample).

[db.go:711 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L711)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) PagesSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Scanned], error)
```

##### `PagesScan`

PagesScan submits [DatabaseOn.PagesScan](#PagesScan).

[db.go:528 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L528)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) PagesScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *PagesScanConfig,
) (*Deferred[Scanned], error)
```

##### `StringsMeasure`

StringsMeasure submits [DatabaseOn.StringsMeasure](#StringsMeasure).

[db.go:538 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L538)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) StringsMeasure(
    collections Collections,
    arena *Arena,
    config *StringsMeasureConfig,
) (*Deferred[Measurement], error)
```

##### `StringsRead`

StringsRead submits [DatabaseOn.StringsRead](#StringsRead).

[db.go:157 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L157)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) StringsRead(
    collections Collections,
    strings Tape,
    arena *Arena,
) (*Deferred[Mapped], error)
```

##### `StringsSample`

StringsSample submits [DatabaseOn.StringsSample](#StringsSample).

[db.go:488 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L488)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) StringsSample(
    collections Collections,
    wanted uint,
    arena *Arena,
) (*Deferred[Listing], error)
```

##### `StringsScan`

StringsScan submits [DatabaseOn.StringsScan](#StringsScan).

[db.go:263 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L263)

Inherited from `deferredReads[Handle]`

```go
func (on SnapshotDeferredOn) StringsScan(
    collections Collections,
    wanted uint,
    arena *Arena,
    config *StringsScanConfig,
) (*Deferred[Listing], error)
```

#### Struct `SnapshotOn`

SnapshotOn is the receiver whose verbs block until their call is final, reading the state a snapshot pinned; nothing writes through it.

[db.go:719 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L719)

```go
type SnapshotOn struct {
    // contains filtered or unexported fields
}
```

#### Struct `StringsCursor`

StringsCursor walks the strings of one collection page by page, in the order of their text, every pull resuming past the last string the pull before it handed out.2

[strings.go:337 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/strings.go#L337)

```go
type StringsCursor struct {
    StringsCursorOn
    // contains filtered or unexported fields
}
```

##### `Next*NextPairs`

× 2 NextPairs pulls up to wanted strings of the walk with the keys they map onto into arena.

[strings.go:433 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/strings.go#L433)

Inherited from `StringsCursorOn`

```go
func (on StringsCursor) NextNextPairs(
    wanted uint,
    arena *Arena,
) (StringsPage, error)
```

##### `Next*NextStrings`

× 2 NextStrings pulls up to wanted strings of the walk into arena.

[strings.go:422 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/strings.go#L422)

Inherited from `StringsCursorOn`

```go
func (on StringsCursor) NextNextStrings(
    wanted uint,
    arena *Arena,
) (StringsPage, error)
```

#### Struct `StringsCursorOn`

StringsCursorOn is the receiver whose pulls block until their call is final: on the calling goroutine when embedded in a [StringsCursor](#StringsCursor), or on an executor that [StringsCursorOn.On](#On) picks.

[strings.go:346 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/strings.go#L346)

```go
type StringsCursorOn struct {
    // contains filtered or unexported fields
}
```

#### Struct `Transaction`

Transaction groups reads and writes across collections and modalities, and commits all of them or none.8

[db.go:1581 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1581)

```go
type Transaction struct {
    TransactionOn
    // contains filtered or unexported fields
}
```

Its own verbs run on the calling goroutine and watch the keys they touch, while [Transaction.View](#View) picks another watch. It serves one call at a time and holds its database open until [Transaction.Close](#Close).

##### `Close`

Close releases the transaction once every deferred call naming it is final, dropping whatever it did not commit.

[db.go:1620 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1620)

```go
func (transaction *Transaction) Close() error
```

It is idempotent.

##### `View`

View is the receiver whose reads and writes, on the calling goroutine, record their keys under watch.

[db.go:1612 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1612)

```go
func (transaction *Transaction) View(watch Watch) TransactionOn
```

##### `*Commit`

× 2 Commit lands every change of the transaction at once, or none of them with a conflict status, answering its position in commit order.

[db.go:1686 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1686)

Inherited from `TransactionOn`

```go
func (on Transaction) Commit(
    durability Durability,
) (CommitStamp, error)
```

##### `*Deferred`

× 2 Deferred is the receiver whose verbs submit their calls to executor, under the same watch.

[db.go:712 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L712)

Inherited from `TransactionOn`

```go
func (on Transaction) Deferred(
    executor *Executor,
) TransactionDeferredOn
```

##### `*On`

× 2 On is the receiver whose verbs block on executor, under the same watch.

[db.go:706 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L706)

Inherited from `TransactionOn`

```go
func (on Transaction) On(executor *Executor) TransactionOn
```

##### `*Reset`

× 2 Reset reopens the transaction on the newest state for another try, dropping its contents.

[db.go:1630 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1630)

Inherited from `TransactionOn`

```go
func (on Transaction) Reset() error
```

##### `*Rollback`

× 2 Rollback withdraws a stage while keeping the reads and writes, so that the transaction can stage again.

[db.go:1718 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1718)

Inherited from `TransactionOn`

```go
func (on Transaction) Rollback() error
```

##### `*Stage`

× 2 Stage validates the transaction and holds its keys, answering the stamp it reads at and its commit validates against.

[db.go:1655 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L1655)

Inherited from `TransactionOn`

```go
func (on Transaction) Stage() (ReadStamp, error)
```

#### Struct `TransactionOn`

TransactionOn is the receiver whose verbs block until their call is final, reading and writing inside a transaction under one [Watch](https://www.unum.cloud/docs/ustore/go/transactions.md#Watch).

[db.go:695 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/db.go#L695)

```go
type TransactionOn struct {
    // contains filtered or unexported fields
}
```

#### Enum `Transport`

Transport is how the NVMe engine moves bytes between its files and memory.2

[types.go:343 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L343)

```go
type Transport int32
```

#### Values

| `TransportAutomatic` | | TransportAutomatic takes io_uring where the kernel offers it, Linux AIO where it offers only that, and blocking calls elsewhere. |
| - | - | - |
| `TransportBlocking` | | TransportBlocking takes positioned reads and writes that block the polling thread. |
| `TransportLinuxUring` | | TransportLinuxUring takes io_uring on unbuffered files. |
| `TransportLinuxAIO` | | TransportLinuxAIO takes Linux AIO on unbuffered files. |
| `TransportLinuxSPDK` | | TransportLinuxSPDK takes SPDK's user-space driver on NVMe devices the process owns. |

##### `TransportFromName`

TransportFromName reads a transport back from the spelling [Transport.String](https://www.unum.cloud/docs/ustore/go/platform-notes.md#String) renders.

[types.go:365 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L365)

```go
func TransportFromName(name string) (Transport, error)
```

##### `String`

String renders the transport as the library spells it.

[types.go:360 ↗](https://github.com/unum-cloud/UStore/blob/084197c470a8c329d83051d880c71e7972b9e1b2/types.go#L360)

```go
func (transport Transport) String() string
```
