diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-23 07:50:00 +0100 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-23 07:50:00 +0100 |
| commit | 188068f051976f8dd4bf1b0da5fcb4bc2c6ae185 (patch) | |
| tree | 339a0eb7b9d72d8f716e153a77c1052be0b5f58d /src/thread.rs | |
| parent | ba417206ed8bb2341dcad5655d91ad09f6a0f073 (diff) | |
| download | mail-188068f051976f8dd4bf1b0da5fcb4bc2c6ae185.tar.gz | |
cleanup
Diffstat (limited to 'src/thread.rs')
| -rw-r--r-- | src/thread.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/thread.rs b/src/thread.rs index 2a502b4..2743f0a 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -2,14 +2,17 @@ use std; use std::{ ops, marker, - ptr, + str, + result }; +use std::ffi::{CString, CStr}; use error::Result; use ffi; use utils::{ NewFromPtr, + ToStr }; use Query; @@ -27,6 +30,14 @@ impl<'q, 'd> NewFromPtr<*mut ffi::notmuch_thread_t> for Thread<'q, 'd> { impl<'q, 'd> Thread<'q, 'd>{ + pub fn id(self: &Self) -> result::Result<&'q str, str::Utf8Error>{ + let tid = unsafe { + ffi::notmuch_thread_get_thread_id(self.0) + }; + tid.to_str() + } + + pub fn total_messages(self: &Self) -> i32{ unsafe { ffi::notmuch_thread_get_total_messages(self.0) |
