Function notmuch_sys::notmuch_message_get_properties [] [src]

pub unsafe extern "C" fn notmuch_message_get_properties(
    message: *mut notmuch_message_t,
    key: *const c_char,
    exact: notmuch_bool_t
) -> *mut notmuch_message_properties_t

Get the properties for message, returning a notmuch_message_properties_t object which can be used to iterate over all properties.

The notmuch_message_properties_t object is owned by the message and as such, will only be valid for as long as the message is valid, (which is until the query from which it derived is destroyed).

@param[in] message The message to examine @param[in] key key or key prefix @param[in] exact if TRUE, require exact match with key. Otherwise treat as prefix.

Typical usage might be:

notmuch_message_properties_t *list;

for (list = notmuch_message_get_properties (message, "testkey1", TRUE);
     notmuch_message_properties_valid (list); notmuch_message_properties_move_to_next (list)) {
   printf("%s\n", notmuch_message_properties_value(list));
}

notmuch_message_properties_destroy (list);

Note that there's no explicit destructor needed for the notmuch_message_properties_t object. (For consistency, we do provide a notmuch_message_properities_destroy function, but there's no good reason to call it if the message is about to be destroyed).

@since libnotmuch 4.4 (notmuch 0.23)