Closed nabijaczleweli closed 1 year ago
This is currently intentional that the messages are only valid for the closure iteration. The documentation states that the returned pointer doesn't survive curl_multi_remove_handle which can be called on &self
. You'll need to copy data out of the Message
to push it onto your vector.
yep, actually using this revealed that it segfaults (but not when being traced, natch)
The current
one meant that
was illegal because
If it's not obvious at first glance, this is because
Message
is actuallyMessage<'multi>
, and the inferred lifetime was, expectedly, matching the&mut self
of theFnMut
(or close enough).Instead, spec
messages<'s>(&'s self)
withFnMut(Message<'s>)
, which fixes the above snippet by binding the'multi
to theMulti
.