-
Effekt Library
- buffer
- BufferOverflow
- Buffer
- capacity
- full?
- empty?
- read
- write
- emptyBuffer
- arrayBuffer
- refBuffer
- main
- buffer Jump to source: libraries/common/buffer.effekt
- BufferOverflow
- Buffer
[T]
- capacity
: Int / {}
- full?
: Bool / {}
- empty?
: Bool / {}
- read
: Option[T] / {}
- write
(el: T): Unit / {Exception[BufferOverflow]}
- emptyBuffer
[T] (capacity: Int): Buffer[T] at {global} / {}
- arrayBuffer
[T] (initialCapacity: Int): Buffer[T] at {global} / {}
- refBuffer
[T]: Buffer[T] at {global} / {}
- main
Example usage: examples/stdlib/buffer
Fixed-size ring buffers (queues) where one can write elements to the head and read from the tail.
The remaining capacity
Is this buffer full?
Is this buffer empty?
Read an element from the tail of the buffer
Write an element to the head of the buffer