From f307901a09bbb426ae3e0ccf3dec40b69ef68b8f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 24 Jul 2022 21:39:32 +0200 Subject: util.queue: Add Teal interface description --- teal-src/util/queue.d.tl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 teal-src/util/queue.d.tl (limited to 'teal-src/util/queue.d.tl') diff --git a/teal-src/util/queue.d.tl b/teal-src/util/queue.d.tl new file mode 100644 index 00000000..cb8458e7 --- /dev/null +++ b/teal-src/util/queue.d.tl @@ -0,0 +1,21 @@ +local record lib + record queue + size : integer + count : function (queue) : integer + enum push_errors + "queue full" + end + + push : function (queue, T) : boolean, push_errors + pop : function (queue) : T + peek : function (queue) : T + replace : function (queue, T) : boolean, push_errors + type iterator = function (T, integer) : integer, T + items : function (queue) : iterator, T, integer + type consume_iter = function (queue) : T + consume : function (queue) : consume_iter + end + + new : function (size:integer, allow_wrapping:boolean) : queue +end +return lib; -- cgit v1.2.3