Buffer v0.2.0 Buffer behaviour View Source

Behaviour for Buffer

Link to this section Summary

Types

An item in a buffer

t()

Callbacks

Creates a new emtpy buffer

Pops count items from the buffer. Returns {items, buffer}. If there are less than count items in the buffer all items are popped.

Pushes items into the buffer and returns the buffer

Returns the number of items in the buffer

Link to this section Types

An item in a buffer

Link to this section Callbacks

Creates a new emtpy buffer

Link to this callback

pop(t, count)

View Source
pop(t(), count :: integer()) :: {[item()], t()}

Pops count items from the buffer. Returns {items, buffer}. If there are less than count items in the buffer all items are popped.

Link to this callback

push(t, list)

View Source
push(t(), [item()]) :: t()

Pushes items into the buffer and returns the buffer

Returns the number of items in the buffer