pub struct Notmuch { /* private fields */ }Implementations§
Source§impl Notmuch
impl Notmuch
pub fn new(paths: Arc<MailPaths>) -> Self
pub fn paths(&self) -> &MailPaths
pub async fn revision(&self) -> Result<Revision>
pub async fn count(&self, query: &Query) -> Result<usize>
Sourcepub async fn count_batch(&self, queries: &[String]) -> Result<Vec<u64>>
pub async fn count_batch(&self, queries: &[String]) -> Result<Vec<u64>>
Counts many queries in one process.
The sidebar asks for a count per row, and spawning notmuch per row costs
more than the counting does. --batch reads one query per line and
writes one count per line, in order. No write lock: counting is a read,
and Xapian’s single-writer rule does not reach it.
An empty line means “everything” to notmuch, so a blank query would silently return the whole database rather than nothing. They are substituted before sending and answered as 0.
pub async fn search_threads(&self, query: &Query) -> Result<Vec<ThreadSummary>>
pub async fn thread(&self, id: &ThreadId) -> Result<Thread>
pub async fn message(&self, id: &MessageId) -> Result<Message>
pub async fn message_file(&self, id: &MessageId) -> Result<PathBuf>
pub async fn parsed(&self, id: &MessageId) -> Result<Arc<ParsedMessage>>
pub async fn message_with_parts(&self, id: &MessageId) -> Result<Message>
pub async fn body( &self, id: &MessageId, format: BodyFormat, allow_remote_resources: bool, ) -> Result<Body>
pub async fn part(&self, id: &MessageId, part: &PartId) -> Result<Part>
Sourcepub async fn address_book(&self, limit: usize) -> Result<AddressBook>
pub async fn address_book(&self, limit: usize) -> Result<AddressBook>
The address book, built from who you have written to and who has written to you. Recipients are collected first so they outrank senders.
Sourcepub async fn mailing_lists(&self, scan: usize) -> Result<Vec<MailingList>>
pub async fn mailing_lists(&self, scan: usize) -> Result<Vec<MailingList>>
The mailing lists recent mail arrived from.
notmuch cannot enumerate List-Id values — it is not even a searchable
prefix unless index.header.List is configured — so this reads the
header off recent message files and tallies them. It is bounded by
scan files for that reason: the cost is real, and unbounded it would
grow with the maildir.
Sourcepub async fn indexes_list_id(&self) -> bool
pub async fn indexes_list_id(&self) -> bool
Whether List: is a searchable prefix, which needs
index.header.List=List-Id and a reindex. Without it the list rows
would render and then match nothing when clicked.
Every tag in the database, for query completion.