FastAppender

Undocumented in source.

Constructors

this
this(size_t capacity)

Preallocate

this
this(I[] arr)

Start with a given buffer

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

allocator
alias allocator = Allocator.instance
Undocumented in source.
put
alias put = putEx
Undocumented in source.

Functions

allocate
T[] allocate(size_t len)

Allocate a number of bytes, without initializing them, and return the slice to be filled in. The slice reference is temporary, and valid until the next allocation.

clear
void clear()

Effectively empties the data, but preserves the storage for reuse. Same as setting length to 0.

get
I[] get()

Get a reference to the buffer. Ownership of the buffer is passed to the caller (Appender will not deallocate it after this call).

opOpAssign
void opOpAssign(U item)
Undocumented in source. Be warned that the author may not have intended to support it.
peek
I[] peek()

As with get, but ownership is preserved. The return value is valid until the next allocation, or until Appender is destroyed.

preallocate
void preallocate(size_t len)

Ensure we can append at least len more bytes before allocating.

putEx
void putEx(U items)

Put elements. Accepts any number of items (and will allocate at most once per call). Items can be of the element type (I), or arrays.

uncheckedPut
void uncheckedPut(U items)

Unsafe. Use together with preallocate().

Properties

capacity
size_t capacity [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
capacity
size_t capacity [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length [@property setter]

Set the length (up to the current capacity).

Templates

CanPutAll
template CanPutAll(U...)
Undocumented in source.

Variables

allocator
Allocator allocator;
Undocumented in source.

Meta