Skip to documentation
SLOP

tiny.preserves.encodeText

Reference tiny.preserves encodeText

Defined in text_writer.

Returns the text of value as new bytes allocated with allocator.

Called byCallstest sourcelib.preserves.src.text.writertest: symbol that looks like a number...test sourcelib.preserves.src.text.writertest: text encode primitivestest sourcelib.preserves.src.text.writertest: text encode rejects duplicate s...test sourcelib.preserves.src.text.writertest: u128 and big integer decimaltext.writerwriteValuetext_writerencode
Static calls · unresolved targets: 2 · external targets: 1.

Source

Source: lib/preserves/src/text/writer.zig:37

zig
/// Returns the text of `value` as new bytes allocated with `allocator`. Code that saves or prints a/// value calls it for new text the caller owns. The caller owns the bytes and frees them with/// `allocator`. On any error the call frees what it wrote.pub fn encode(comptime D: type, allocator: Allocator, value: value_mod.Value(D)) EncodeError![]u8 {    var buf: ArrayList = .empty;    errdefer buf.deinit(allocator);    try writeValue(D, allocator, &buf, value);    return buf.toOwnedSlice(allocator);}

Source: lib/preserves/src/root.zig:300

zig
pub const encodeText = text.encode;

Also reachable as

text.encode, text.writer.encode.

Audit

Definitions1
Public names4
Members0
Version26.7.0
Revisiondaab053ee433