diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-23 20:51:21 +0100 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-23 20:51:21 +0100 |
| commit | c522a72b61c943841da9ba8324694af8ffbce1dc (patch) | |
| tree | 3e9a9c5b06ae766dd663c6762421c9a17eb633ff | |
| parent | 42c5b215ddcc154d647ec268d4da044f32948227 (diff) | |
| download | mail-c522a72b61c943841da9ba8324694af8ffbce1dc.tar.gz | |
threads: oldest and newest date
| -rw-r--r-- | src/thread.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/thread.rs b/src/thread.rs index 2182d69..9148c44 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -5,6 +5,7 @@ use std::{ str, result }; + use std::ffi::{CString, CStr}; use error::Result; @@ -90,8 +91,19 @@ impl<'q, 'd> Thread<'q, 'd>{ athrs.to_str().unwrap().split(",").map(|s| s.to_string()).collect() } + /// Get the date of the oldest message in 'thread' as a time_t value. + pub fn oldest_date(self: &Self) -> i64 { + unsafe { + ffi::notmuch_thread_get_oldest_date(self.0) + } + } - + /// Get the date of the newest message in 'thread' as a time_t value. + pub fn newest_date(self: &Self) -> i64 { + unsafe { + ffi::notmuch_thread_get_newest_date(self.0) + } + } } |
