btck::write_bytes

Serializes a C object into a byte vector using its to_bytes callback.

Synopsis

Declared in <kernel/bitcoinkernel_wrapper.h>

template<typename T>
std::vector<std::byte>
write_bytes(
    T const* object,
    int(* to_bytes)(T const*, btck_WriteBytes, void*));

Return Value

The serialized bytes.

Parameters

NameDescription
objectThe C object to serialize.
to_bytesThe btck_*_to_bytes function that streams the object's bytes.