diff options
| author | rhn <gihu.rhn@porcupinefactory.org> | 2018-04-13 11:21:42 +0200 |
|---|---|---|
| committer | rhn <gihu.rhn@porcupinefactory.org> | 2018-04-13 11:27:27 +0200 |
| commit | 1f2c854d2045257352363b80559332cea4e24dcd (patch) | |
| tree | 72751688f19f9e8fbe2458fea9ac2a4f76903497 | |
| parent | c621f5cf919cfc8c94b5eaf0a9df6074a4e7a6cf (diff) | |
| download | mail-1f2c854d2045257352363b80559332cea4e24dcd.tar.gz | |
Add Directory::child_directories
| -rw-r--r-- | src/directory.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/directory.rs b/src/directory.rs index 7b00d70..c3b313b 100644 --- a/src/directory.rs +++ b/src/directory.rs @@ -8,6 +8,7 @@ use utils::{ }; use Database; +use Filenames; use ffi; @@ -17,6 +18,14 @@ pub struct Directory<'d>( marker::PhantomData<&'d mut Database>, ); +impl<'d> Directory<'d>{ + pub fn child_directories(self: &Self) -> Filenames<'d>{ + Filenames::new(unsafe { + ffi::notmuch_directory_get_child_directories(self.0) + }) + } +} + impl<'d> NewFromPtr<*mut ffi::notmuch_directory_t> for Directory<'d> { fn new(ptr: *mut ffi::notmuch_directory_t) -> Directory<'d> { Directory(ptr, marker::PhantomData) |
