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.
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
| Definitions | 1 |
|---|---|
| Public names | 4 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |