From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 40DB16DE1885 for ; Sat, 11 Mar 2017 14:44:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D-JSlWQMEYiB for ; Sat, 11 Mar 2017 14:44:31 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id D3F426DE12DD for ; Sat, 11 Mar 2017 14:44:30 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1cmpjj-0004QI-LZ; Sat, 11 Mar 2017 17:43:43 -0500 Received: (nullmailer pid 26563 invoked by uid 1000); Sat, 11 Mar 2017 22:44:23 -0000 From: David Bremner To: Steven Allen , Jani Nikula Cc: notmuch@notmuchmail.org Subject: Re: [PATCH] Add a method to reparent threads to the database. In-Reply-To: <20151108191536.GA3115@stebalien.com> References: <1446408428-7703-1-git-send-email-steven@stebalien.com> <1446930269-4865-1-git-send-email-steven@stebalien.com> <878u6875p0.fsf@nikula.org> <20151108191536.GA3115@stebalien.com> Date: Sat, 11 Mar 2017 18:44:23 -0400 Message-ID: <8760jfqvqw.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Mar 2017 22:44:32 -0000 Steven Allen 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).