From bd1a184600a0d42c36d7d2fc5f010692d0ab46aa Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Thu, 25 Oct 2018 08:02:04 +0200 Subject: more correct lifetimes --- src/query.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/query.rs') diff --git a/src/query.rs b/src/query.rs index b4cd9a2..a95c9c2 100644 --- a/src/query.rs +++ b/src/query.rs @@ -11,6 +11,8 @@ use Database; use Messages; use Threads; use ffi::Sort; +use threads::ThreadsOwner; +use messages::MessagesOwner; #[derive(Debug)] pub(crate) struct QueryPtr { @@ -31,6 +33,10 @@ pub struct Query<'d>{ phantom: PhantomData<&'d Database>, } +impl<'d> ThreadsOwner for Query<'d>{} +impl<'d> MessagesOwner for Query<'d>{} + + impl<'d> FromPtr<*mut ffi::notmuch_query_t> for Query<'d> { fn from_ptr(ptr: *mut ffi::notmuch_query_t) -> Query<'d> { Query{ @@ -68,7 +74,7 @@ impl<'d> Query<'d> { /// Filter messages according to the query and return - pub fn search_messages<'q>(self: &'d Self) -> Result> + pub fn search_messages<'q>(self: &'d Self) -> Result> { let mut msgs = ptr::null_mut(); try!(unsafe { @@ -92,7 +98,7 @@ impl<'d> Query<'d> { Ok(cnt) } - pub fn search_threads<'q>(self: &'d Self) -> Result> + pub fn search_threads<'q>(self: &'d Self) -> Result> { let mut thrds = ptr::null_mut(); try!(unsafe { -- cgit v1.2.1