Render functionv0.1.0
pub func Render(
allocator: Allocator,
#Format() format: char8[..],
...
) -> String ! FormatError
This is the allocating entry point, and the only one: every other way of rendering writes into a destination the
caller already has. Reserving up front is a guess at the result's size — the literal text plus a little for each
argument — so a short call fills in without a reallocation and a long one grows through the builder as usual.
It is named for what it does rather than for the package, because Format(allocator, ...) read as a noun and a
namespace at once and said nothing about producing a value.
Reports TextFailure(OutOfMemory) when the initial reservation fails, and otherwise whatever WriteFormat
reported. On failure the partially built string is released rather than returned, so a caller never receives
half a rendering that looks whole and the allocator gets its block back either way.
Parameters
| Name | Type | Description |
|---|---|---|
allocator | Allocator | what the returned string is built with and will give its block back to |
#Format() format | char8[..] | |
... |
Returns: the rendered string, or why it could not be produced