use std::ffi::CStr; use std::iter::Iterator; use std::ops::Drop; use std::path::PathBuf; use ffi; use utils::ScopedPhantomcow; pub trait FilenamesOwner {} #[derive(Debug)] pub struct Filenames<'o, O> where O: FilenamesOwner + 'o, { pub(crate) ptr: *mut ffi::notmuch_filenames_t, pub(crate) marker: ScopedPhantomcow<'o, O>, } impl<'o, O> Drop for Filenames<'o, O> where O: FilenamesOwner + 'o, { fn drop(self: &mut Self) { unsafe { ffi::notmuch_filenames_destroy(self.ptr) }; } } impl<'o, O> Filenames<'o, O> where O: FilenamesOwner + 'o, { pub(crate) fn from_ptr
(ptr: *mut ffi::notmuch_filenames_t, owner: P) -> Filenames<'o, O>
where
P: Into