def Utf8.scan_seek

mylsm-lsm-store@0.6.0.1 · mylsm.bend:2189

import mylsm-lsm-store@0.6.0.1/mylsm.bend as Mylsm
import Base

2189# Seeks an active text cursor by UTF-8 key, preserving terminal cursors.
2190def Utf8.scan_seek(
2191  cursor: Utf8.Cursor,
2192  lower: Maybe<&2, String>
2193) -> IO(Utf8.Cursor & Result<&1, &1, Utf8.Error, Unit>):
2194  match cursor:
2195    case Utf8Cursor{inner, Utf8CursorActive{}}:
2196      do IO<Utf8.Cursor & Result<&1, &1, Utf8.Error, Unit>>:
2197        pair : Bytes.Cursor & Result<&1, &1, Utf8.Error, Unit> <-
2198          Utf8.scan_seek.active(inner, Utf8.scan.bound(lower))
2199        return Utf8.scan_seek.result(pair)
2200    case Utf8Cursor{inner, state}:
2201      IO.pure(Utf8.Cursor & Result<&1, &1, Utf8.Error, Unit>,
2202        (Utf8Cursor{inner, state}, Done{Unit{}}))

Uses (16)

Used by (0)

No other definition uses this definition.