Steven Allen <steven@stebalien.com> writes: > I'm writing high-level rust bindings for notmuch and would like to > enable encapsulation of query logic. That is, I'd like to be able to > write a function that performs a (set of) query(s) and returns a (or a > set of) message(s)/thread(s). I can't do this currently because the > messages/threads can't outlive the query. I could use reference counting > to store the query until all messages/threads have been freed but that > feels messy and shouldn't, strictly speaking, be necessary. It probably wouldn't be as efficient, but it might be a cleaner API to have a way to copy a message or thread into a malloced (or maybe user-provided buffer).