<div dir="ltr"><div>Thanks.</div><div><br></div><div>For the most part, that's what I ended up with, but the thread 'stealing' a message will be quite hard to implement in Rust, I guess.</div><div>When using notmuch_query_search_messages, I was assuming the resulting individual messages to be owned by the query.</div><div>So, if at a later point in time, one uses notmuch_query_search_threads, will the ownership of a previous message abruptly be</div><div>transferred from query to thread?</div><div>I do want to be able to run *_destroy at some point :)</div><div><br></div><div>-Dirk</div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 20 Dec 2018 at 10:11, David Bremner <<a href="mailto:david@tethera.net">david@tethera.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dirk Van Haerenborgh <<a href="mailto:vhdirk@gmail.com" target="_blank">vhdirk@gmail.com</a>> writes:<br>
<br>
<br>
> For instance, when iterating messages from a thread: Can one still use a<br>
> notmuch_message_t* when the thread is destroyed?<br>
> Are the individual<br>
> messages 'owned' by the thread, or only by the query? Same question for<br>
> 'replies'.<br>
><br>
> Could someone please shed some light on this? I'd very much appreciate it.<br>
<br>
It's hierarchical (the underlying allocator is talloc). So threads are<br>
owned by the corresponding query, and messages are owned by threads.<br>
<br>
Assuming replies refers to notmuch_message_get_replies, then those are<br>
owned by some thread as well.<br>
<br>
Threads are somewhat lazily constructed, so there's a time where a<br>
message is owned by a query before it is "stolen" by a thread.<br>
<br>
This is all Carl's design, so hopefully he'll correct me if I said<br>
anything outrageously wrong.<br>
<br>
d<br>
<br>
<br>
<br>
</blockquote></div></div>