Serializer.serialize

Serializes the data in src.

Note that the serialization process may expand the dst buffer more than ultimately necessary, but it always returns a slice into the buffer that covers bytes of the struct instance itself, not including any of indirections (that are placed after). Therefore calling applications should be careful to use the returned buffer rather than the dst buffer directly.

  1. void[] serialize(S src, Buffer!(void) dst)
  2. void[] serialize(S src, D[] dst)
    struct Serializer
    static
    void[]
    serialize
    (
    S
    D
    )
    (
    ref S src
    ,
    ref D[] dst
    )
  3. void[] serialize(Contiguous!(S) src)

Parameters

S

type of the struct to dump

src S

struct to serialize

dst D[]

buffer to write to. It is only extended if needed and never shrunk

Return Value

Type: void[]

the slice to the serialize data

Meta