Skip to main content

fetch_folder

Function fetch_folder 

Source
pub async fn fetch_folder<T: AsyncRead + AsyncWrite + Unpin>(
    client: &mut MapClient<T>,
    folder: Folder,
    since_ms: Option<i64>,
    now: i64,
    template: &ListMessagesFilter,
) -> Result<Vec<FetchedMessage>>
Expand description

Lists folder and fetches each message body since since_ms.

template is forwarded to list_folder for device-side filtering (currently just read_status). Entries older than since_ms (by listing datetime) are skipped before the body fetch, so a caller passing the per-folder cursor anchor fetches only new messages; None fetches the full window. now is the fallback timestamp for entries with an absent/malformed datetime. Pure device read: no store access, no cursor writes.

§Errors

Returns an error if any MAP set_folder/list_messages/get_message operation fails.