Frame

An object that encapsulates a $(ZMQ) message frame.

This struct is a wrapper around a zmq_msg_t object. A default-initialized Frame is not a valid $(ZMQ) message frame; it should always be explicitly initialized upon construction using $(FREF _Frame.opCall). Alternatively, it may be initialized later with $(FREF _Frame.rebuild).

Frame msg1;                 // Invalid frame
auto msg2 = Frame();        // Empty frame
auto msg3 = Frame(1024);    // 1K frame
msg1.rebuild(2048);         // msg1 now has size 2K
msg2.rebuild(2048);         // ...and so does msg2

When a Frame goes out of scope, $(ZMQREF zmq_msg_close()) is called on the underlying zmq_msg_t.

A Frame cannot be copied by normal assignment; use $(FREF _Frame.copy) for this.

Destructor

~this
~this()

Releases the $(ZMQ) message frame when the Frame is destroyed.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

close
void close()

Releases the $(ZMQ) message frame.

copy
Frame copy()
copyTo
void copyTo(Frame dest)

Copies frame content to another message frame.

move
Frame move()
moveTo
void moveTo(Frame dest)

Moves frame content to another message frame.

rebuild
void rebuild()

Reinitializes the Frame object as an empty message.

rebuild
void rebuild(size_t size)

Reinitializes the Frame object to a specified size.

rebuild
void rebuild(ubyte[] data)

Reinitializes the Frame object from a supplied buffer.

Properties

data
ubyte[] data [@property getter]

Retrieves the message frame content.

handle
inout(zmq_msg_t)* handle [@property getter]

A pointer to the underlying zmq_msg_t.

more
bool more [@property getter]

Whether there are more message frames to retrieve.

size
size_t size [@property getter]

The message frame content size in bytes.

Static functions

opCall
Frame opCall()

Initializes an empty $(ZMQ) message frame.

opCall
Frame opCall(size_t size)

Frame.opCall_size Initializes a $(ZMQ) message frame of a specified size.

opCall
Frame opCall(ubyte[] data)

Frame.opCall_data Initializes a $(ZMQ) message frame from a supplied buffer.

Meta