FlexibleByteRingQueue.push

Reserves space for an item of <size> bytes on the queue but doesn't fill the content. The caller is expected to fill in the content using the returned slice.

size = 0 is allowed.

  1. bool push(void[] item)
  2. void[] push(size_t size)
    class FlexibleByteRingQueue
    void[]
    push
    (
    size_t size
    )
    out (slice) { assert (slice is null || slice.length == size, classname(this) ~ "push: length of returned buffer not as requested"); }

Parameters

size size_t

size of the space of the item that should be reserved

Return Value

Type: void[]

slice to the reserved space if it was successfully reserved, else null. Returns non-null empty string if size = 0 and the item was successfully pushed.

Out: The length of the returned array slice is size unless the slice is null.

Meta