diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-23 07:28:07 +0100 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-23 07:28:07 +0100 |
| commit | ba417206ed8bb2341dcad5655d91ad09f6a0f073 (patch) | |
| tree | 6ea86e1fed38de283bfa8893c4dee87bfab3bf32 /src/thread.rs | |
| parent | be546fe6e4b709d1bb8770fdf0763ce4f494d0d6 (diff) | |
| download | mail-ba417206ed8bb2341dcad5655d91ad09f6a0f073.tar.gz | |
thread: count messages and files
Diffstat (limited to 'src/thread.rs')
| -rw-r--r-- | src/thread.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/thread.rs b/src/thread.rs index cf5440c..2a502b4 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -25,12 +25,22 @@ impl<'q, 'd> NewFromPtr<*mut ffi::notmuch_thread_t> for Thread<'q, 'd> { } } -// impl<'d> Thread<'d>( -// -// -// -// }; -// +impl<'q, 'd> Thread<'q, 'd>{ + + pub fn total_messages(self: &Self) -> i32{ + unsafe { + ffi::notmuch_thread_get_total_messages(self.0) + } + } + + pub fn total_files(self: &Self) -> i32{ + unsafe { + ffi::notmuch_thread_get_total_files(self.0) + } + } + +} + impl<'q, 'd> ops::Drop for Thread<'q, 'd> { fn drop(&mut self) { |
