def handle.found

bend-kit-commands@0.4.0.0 · commands.bend:349

import bend-kit-commands@0.4.0.0/commands.bend as Commands
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

349# A duplicate reads no rows: step ignores them when found is Some.
350def handle.found(
351  ~keys: Bytes.Bytes -> List<Bytes.Bytes>,
352  ~decide: List<Row> -> Bytes.Bytes -> Decision<List<Row>, Bytes.Bytes, Bytes.Bytes>,
353  found: Maybe<Record<Bytes.Bytes, Bytes.Bytes>>, +read: U32, payload: Bytes.Bytes, at: U32,
354  +commit: U32, +save: U32, +del: U32, +keep: U32, +emit: U32, +id: String
355) -> Run(Reply<Bytes.Bytes>):
356  match found:
357    case None{}:
358      handle.new(~keys, ~decide, Bytes.clone(payload), read, at, commit, save, del, keep, emit, id)
359    case Some{rec}:
360      written(step(~List<Row>, ~Bytes.Bytes, ~Bytes.Bytes, ~Bytes.Bytes, ~same, ~Bytes.clone, ~Bytes.clone, ~decide, Some{rec}, Nil{}, payload, at), commit, save, del, keep, emit, id)

Uses (15)

Used by (1)