From 0a9446795bd19a3017482f702df01ebaadadfd48 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Wed, 9 Sep 2026 22:12:44 -0300 Subject: cursor and context --- lib/protocols/Cursor.mli | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/protocols/Cursor.mli (limited to 'lib/protocols/Cursor.mli') diff --git a/lib/protocols/Cursor.mli b/lib/protocols/Cursor.mli new file mode 100644 index 0000000..08c7628 --- /dev/null +++ b/lib/protocols/Cursor.mli @@ -0,0 +1,21 @@ +type batch = + {tuples: Concepts.Tuple.t BatFingerTree.t; exhausted: bool} + +type t + +class type implementation = object + method fetch : int -> (batch, Concepts.Condition.condition) result +end + +val make : #implementation -> Handle.protocol +val from : Handle.t -> t Handle.interface option +val require : Handle.t -> (t Handle.interface, Concepts.Condition.condition) result +val fetch : t Handle.interface -> int -> (batch, Concepts.Condition.condition) result + +val next : t Handle.interface -> (Concepts.Tuple.t option, Concepts.Condition.condition) result + +val drain : + t Handle.interface -> + ?limit:int -> + unit -> + (Concepts.Tuple.t BatFingerTree.t, Concepts.Condition.condition) result -- cgit v1.2.3