~/bend-docscommunity

src/scan/SstCursor.bend relies on unsafe/foreign

raw source on the hub · import mylsm-lsm-store@0.6.0.2/src/scan/SstCursor.bend as SstCursor

6 imports
import Base
import ../ByteMemTable.bend as ByteMemTable
import ../ByteWal.bend as ByteWal
import ./ByteBlockReader.bend as ByteBlockReader
import ./ByteRange.bend as ByteRange
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

Types

type Bounds source · line 9 · raw

Type

Carries half-open byte bounds and an optional exact byte prefix.

type Cursor source · line 14 · raw

Type

Owns one validated SST reader and the unread part of its current block.

type Step source · line 21 · raw

Type

Represents a streamed record, filtered entry, end, or terminal error.

type VerifyState source · line 28 · raw

Type

Carries each bounded block validation transition before cursor publication.

type ScanState source · line 34 · raw

Type

Carries one block read or one current block during incremental scanning.

Definitions

def bounds.copy.values source · line 41 · raw

@lower:Pair(Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>, Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>) -> @upper:Pair(Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>, Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>) -> @prefix:Pair(Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>, Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>) -> Pair(Bounds, Bounds)

def bounds.copy source · line 55 · raw

@bounds:Bounds -> Pair(Bounds, Bounds)

def scan.prefix source · line 61 · raw

@key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @prefix:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> Bool

def scan.entry.choose source · line 66 · raw

@valid:Bool -> @key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @value:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @bounds:Pair(Bounds, Bounds) -> IO(Step)

def scan.entry.checked source · line 83 · raw

@key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @value:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @bounds:Pair(Bounds, Bounds) -> @key_copies:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> IO(Step)

def scan.entry.upper.closed source · line 106 · raw

@closed:Result<&1, &1, Pair(U32, String), Unit> -> Step

def scan.entry.upper.result source · line 113 · raw

@reached:Bool -> @key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @value:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @lower:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @prefix:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @retained:Bounds -> @upper_checked:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @key_copies:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> IO(Step)

def scan.entry.upper.copies source · line 134 · raw

@key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @value:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @lower:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @prefix:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @retained:Bounds -> @upper:Pair(Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>, Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes>) -> @key_copies:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> IO(Step)

def scan.entry.upper.fields source · line 154 · raw

@key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @value:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @lower:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @upper:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @prefix:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @retained:Bounds -> @key_copies:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> IO(Step)

def scan.entry.upper.checked source · line 167 · raw

@key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @value:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @bounds:Pair(Bounds, Bounds) -> @key_copies:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> IO(Step)

def scan.entry.key.copied source · line 181 · raw

@value:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @bounds:Pair(Bounds, Bounds) -> @pair:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> IO(Step)

def scan.entry source · line 192 · raw

@entry:0x7586b743ff7fd05e412d5115859629b6/src/ByteMemTable.Entry -> @cursor:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.EntryCursor -> @bounds:Bounds -> IO(Step)

def scan.exhausted source · line 202 · raw

@state:ScanState -> IO(Step)

def scan.loop source · line 222 · raw

@fuel:Nat -> @state:ScanState -> IO(Step)

def verify.exhausted source · line 247 · raw

@state:VerifyState -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def verify.complete.routed.result source · line 264 · raw

@bounds:Bounds -> @result:Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader> -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def verify.complete.routed source · line 275 · raw

@bounds:Bounds -> @result:IO(Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader>) -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def verify.complete.copied source · line 283 · raw

@pair:Pair(Bounds, Bounds) -> @reader:0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def verify.complete source · line 299 · raw

@bounds:Bounds -> @result:Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader> -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def verify.loop source · line 308 · raw

@fuel:Nat -> @path:String -> @state:VerifyState -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def open.budget source · line 334 · raw

@path:String -> @bounds:Bounds -> @pair:Pair(Nat, 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader) -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def open.result source · line 343 · raw

@path:String -> @bounds:Bounds -> @opened:Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader> -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def open.trusted.result source · line 353 · raw

@bounds:Bounds -> @opened:Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader> -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

def open.trusted source · line 364 · raw

@+path:String -> @bounds:Bounds -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

Reopens a previously validated generation without rescanning every block.

def measure.key.opened source · line 373 · raw

@key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @opened:Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader> -> IO(Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/ByteWal.ValueMetadata>)

def measure_key source · line 384 · raw

@path:String -> @key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Result<&1, &1, Pair(U32, String), 0x7586b743ff7fd05e412d5115859629b6/src/ByteWal.ValueMetadata>)

Handles measure key.

def open source · line 392 · raw

@+path:String -> @bounds:Bounds -> IO(Result<&1, &1, Pair(U32, String), Cursor>)

Validates the complete SST before opening a second bounded scan pass.

def scan.start source · line 402 · raw

@pair:Pair(Nat, 0x7586b743ff7fd05e412d5115859629b6/src/scan/ByteBlockReader.Reader) -> @bounds:Bounds -> IO(Step)

def next source · line 407 · raw

@cursor:Cursor -> IO(Step)

Returns the next bounded record, range skip, end, or terminal read error.

def seek source · line 428 · raw

@cursor:Cursor -> @lower:Maybe<&1, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes> -> Cursor

Advances the remaining scan to an inclusive lower byte key.

def close source · line 439 · raw

@cursor:Cursor -> IO(Result<&1, &1, Pair(U32, String), Unit>)

Releases the active file reader, preserving terminal cursors.