graphix-package-db 0.9.0

A dataflow language for UIs and network programming, embedded database package
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// A cursor for iterating over tree entries one at a time.
type Cursor<'k, 'v>;

/// Create a new cursor, optionally filtering by key prefix.
val new: fn(?#prefix: ['k, null], t: Tree<'k, 'v>) -> Cursor<'k, 'v>;

/// Create a cursor over a key range. Both bounds are optional (null = unbounded).
/// Use `Included(key) or `Excluded(key) to specify each bound.
val range: fn(?#start: [`Included('k), `Excluded('k), null], ?#end: [`Included('k), `Excluded('k), null], t: Tree<'k, 'v>) -> Cursor<'k, 'v>;

/// Read the next entry from the cursor. Advances on each trigger.
/// Returns a (key, value) tuple, or null when exhausted.
val read: fn(c: Cursor<'k, 'v>, trigger: Any) -> Result<[('k, 'v), null], `DbErr(string)>;

/// Read up to N entries from the cursor. Returns a shorter array when exhausted.
val read_many: fn(c: Cursor<'k, 'v>, n: i64) -> Result<Array<('k, 'v)>, `DbErr(string)>;