Software /
code /
prosody
Comparison
teal-src/util/queue.d.tl @ 12622:ef59fb975d3e
util.queue: Add Teal interface description
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 24 Jul 2022 21:39:32 +0200 |
comparison
equal
deleted
inserted
replaced
12621:041d067de38b | 12622:ef59fb975d3e |
---|---|
1 local record lib | |
2 record queue<T> | |
3 size : integer | |
4 count : function (queue<T>) : integer | |
5 enum push_errors | |
6 "queue full" | |
7 end | |
8 | |
9 push : function (queue<T>, T) : boolean, push_errors | |
10 pop : function (queue<T>) : T | |
11 peek : function (queue<T>) : T | |
12 replace : function (queue<T>, T) : boolean, push_errors | |
13 type iterator = function (T, integer) : integer, T | |
14 items : function (queue<T>) : iterator, T, integer | |
15 type consume_iter = function (queue<T>) : T | |
16 consume : function (queue<T>) : consume_iter | |
17 end | |
18 | |
19 new : function<T> (size:integer, allow_wrapping:boolean) : queue<T> | |
20 end | |
21 return lib; |