From be546fe6e4b709d1bb8770fdf0763ce4f494d0d6 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Fri, 23 Mar 2018 07:16:39 +0100 Subject: improve lifetime definitions --- src/thread.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/thread.rs') diff --git a/src/thread.rs b/src/thread.rs index 980ff39..cf5440c 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -11,21 +11,28 @@ use ffi; use utils::{ NewFromPtr, }; -use Database; +use Query; #[derive(Debug)] -pub struct Thread<'d>( +pub struct Thread<'q, 'd:'q>( pub(crate) *mut ffi::notmuch_thread_t, - marker::PhantomData<&'d mut Database>, + marker::PhantomData<&'q mut Query<'d>>, ); -impl<'d> NewFromPtr<*mut ffi::notmuch_thread_t> for Thread<'d> { - fn new(ptr: *mut ffi::notmuch_thread_t) -> Thread<'d> { +impl<'q, 'd> NewFromPtr<*mut ffi::notmuch_thread_t> for Thread<'q, 'd> { + fn new(ptr: *mut ffi::notmuch_thread_t) -> Thread<'q, 'd> { Thread(ptr, marker::PhantomData) } } -impl<'d> ops::Drop for Thread<'d> { +// impl<'d> Thread<'d>( +// +// +// +// }; +// + +impl<'q, 'd> ops::Drop for Thread<'q, 'd> { fn drop(&mut self) { unsafe { ffi::notmuch_thread_destroy(self.0) -- cgit v1.2.1