Frame.rebuild

Reinitializes the Frame object from a supplied buffer.

This function will first call $(FREF Frame.close) to release the resources associated with the message frame, and then it will initialize it anew, exactly as if it were constructed with $(LINK2 #Frame.opCall_data,Frame(data)).

  1. void rebuild()
  2. void rebuild(size_t size)
  3. void rebuild(ubyte[] data)
    struct Frame
    @safe
    void
    rebuild
    (
    ubyte[] data
    )

Throws

ZmqException if $(ZMQ) reports an error.

Corresponds to

$(ZMQREF zmq_msg_close()) followed by $(ZMQREF zmq_msg_init_data()).

Examples

auto msg = Frame(256);
assert (msg.size == 256);
auto buf = new ubyte[123];
msg.rebuild(buf);
assert(msg.size == buf.length);
assert(msg.data.ptr == buf.ptr);

Meta