diskann_disk/build/chunking/checkpoint/progress.rs
1/*
2 * Copyright (c) Microsoft Corporation.
3 * Licensed under the MIT license.
4 */
5
6#[derive(Debug, Clone)]
7pub enum Progress {
8 Completed,
9 Processed(usize /* items processed */),
10}
11
12impl Progress {
13 pub fn map(self, f: impl Fn(usize) -> usize) -> Progress {
14 match self {
15 Progress::Completed => Progress::Completed,
16 Progress::Processed(progress) => Progress::Processed(f(progress)),
17 }
18 }
19}