We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 92c638a + 4e9f4e2 commit ea716ceCopy full SHA for ea716ce
src/message.rs
@@ -59,6 +59,15 @@ impl Message {
59
unsafe { Self::alloc(|msg| zmq_sys::zmq_msg_init(msg)) }
60
}
61
62
+ /// Create a `Message` from an initialized `zmq_sys::zmq_msg_t`.
63
+ ///
64
+ /// # Safety
65
66
+ /// `msg` must be initialized.
67
+ pub unsafe fn from_msg(msg: zmq_sys::zmq_msg_t) -> Self {
68
+ Message { msg }
69
+ }
70
+
71
/// Create a `Message` preallocated with `len` uninitialized bytes.
72
///
73
/// Since it is very easy to introduce undefined behavior using this
0 commit comments