Skip to main content

backfill

Function backfill 

Source
pub async fn backfill<T: AsyncRead + AsyncWrite + Unpin>(
    client: &mut MapClient<T>,
    store: &Store,
    folder_scope: Option<Folder>,
) -> Result<()>
Expand description

Fetches MAP messages and upserts them into the store using per-folder cursor anchors.

When folder_scope is None, all four folders are processed in order: Inbox, Sent, Deleted, Outbox. When Some, only the specified folder is processed.

Each folder runs independently: a failure on one folder is logged and skipped so other folders can still advance their cursors. Returns an error if any folder failed.

§Errors

Returns the first folder error encountered. Callers should treat a partial failure as “sync incomplete” and re-run to retry the failed folder(s).