tiny.preserves.encodeText
Defined in text_writer.
Returns the text of value as new bytes allocated with allocator.
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
| Definitions | 1 |
|---|---|
| Public names | 4 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |