Header menu logo XParsec

ReadableArrayBuilder<'T> Type

Append-only builder that materialises into a ReadableArray, usually without copying. Single-shot: after ToReadableArray the builder releases its buffer.

Constructors

Constructor Description

ReadableArrayBuilder()

Full Usage: ReadableArrayBuilder()

Returns: ReadableArrayBuilder<'T>
Returns: ReadableArrayBuilder<'T>

ReadableArrayBuilder(initialCapacity)

Full Usage: ReadableArrayBuilder(initialCapacity)

Parameters:
    initialCapacity : int

Returns: ReadableArrayBuilder<'T>
initialCapacity : int
Returns: ReadableArrayBuilder<'T>

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
    item : 'T

item : 'T

this.Capacity

Full Usage: this.Capacity

Returns: int
Returns: int

this.Count

Full Usage: this.Count

Returns: int
Returns: int

this[index]

Full Usage: this[index]

Returns: int
Returns: int

this.ToReadableArray

Full Usage: this.ToReadableArray

Returns: ReadableArray<'T>

Returns a ReadableArray viewing the first `count` slots of the backing buffer. Always zero-copy: parsing consumers typically work with reasonably-sized buffers and the result is one-shot, so retaining some unused capacity is cheaper than allocating a fresh array + copy (which also punishes LOH-sized buffers by round-tripping through the Gen2 heap). Single-shot: releases the builder's reference — do not reuse.

Returns: ReadableArray<'T>

Type something to start searching.