def snapshot.root.reservation.result

mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:2511

import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as ByteDurableDb
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend as SnapshotPolicy

2511def snapshot.root.reservation.result(
2512  handle: Handle,
2513  path: Maybe<&1, String>,
2514  generation: Maybe<&1, U32>,
2515  delta: List<&1, ByteMemTable.Entry>,
2516  decision: SnapshotPolicy.Decision
2517) -> IO(Handle & Result<&1, &1, Error, SnapshotRoot>):
2518  match decision:
2519    case SnapshotPolicy.ResourceLimit{}:
2520      IO.pure(Handle & Result<&1, &1, Error, SnapshotRoot>,
2521        (handle, Fail{ResourceLimit{}}))
2522    case SnapshotPolicy.Retained{_, retained_bytes}:
2523      IO.pure(Handle & Result<&1, &1, Error, SnapshotRoot>,
2524        (handle, Done{SnapshotRoot{path, generation, retained_bytes, delta}}))

Uses (14)

Used by (1)