FlexibleByteRingQueue.load

Restores the queue state and contents.

Clears the queue, then calls the provided delegate, restore(), to restore the queue state and contents and validates it.

restore() should populate the meta and data buffer it receives with data previously obtained from save(): - meta should be populated with the data from the store() meta parameter, - data[0 .. head.length + tail.length] should be populated with the head ~ tail data as received by the store() delegate during save(), - restore() should return head.length + tail.length.

See the example in the documentation of save().

  1. size_t load(InputStream input)
  2. void load(size_t delegate(void[] meta, void[] data) restore)
    class FlexibleByteRingQueue
    void
    load
    (
    scope size_t delegate
    (
    void[] meta
    ,
    void[] data
    )
    restore
    )

Parameters

restore size_t delegate
(
void[] meta
,
void[] data
)

input delegate

Throws

ValidationError if the input data are inconsistent. When throwing, the queue remains empty.

Meta