Skip to documentation
SLOP

tiny.preserves.encodePacked

Reference tiny.preserves encodePacked

Defined in packed_writer.

Returns the binary encoding of value as new bytes allocated with allocator, for code that stores, sends or fingerprints a value.

Called byCallstest sourcelib.preserves.src.packed.writertest: encode bool and end-of-record a...test sourcelib.preserves.src.packed.writertest: packed encode rejects semantic ...private sourcelib.preserves.src.packed.writerwriteDictionaryprivate sourcelib.preserves.src.packed.writerwriteSetpacked_writerwriteValuepacked_writerencode
Static calls · unresolved targets: 2 · external targets: 1.

Source

Source: lib/preserves/src/packed/writer.zig:40

zig
/// Returns the binary encoding of `value` as new bytes allocated with `allocator`, for code that/// stores, sends or fingerprints a value. The caller owns the bytes and frees them with/// `allocator`. On any error the call frees everything it allocated. Encoding a value that `decode`/// returned gives back the bytes `decode` read.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:298

zig
pub const encodePacked = @"packed".encode;

Also reachable as

@"packed".encode, @"packed".writer.encode.

Audit

Definitions1
Public names4
Members0
Version26.7.0
Revisiondaab053ee433