nominal 0.5.1

Automate Nominal workflows in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::sync::Arc;

/// Events emitted during a multipart upload.
#[derive(Debug, Clone)]
pub enum UploadEvent {
    /// Emitted once, after the upload has been initiated and `total_parts` is known.
    Started { total_bytes: u64, total_parts: u32 },
    /// Emitted each time a part is successfully uploaded to object storage.
    PartCompleted { part_number: u32, bytes: u64 },
    /// Emitted once, after the multipart upload has been finalized.
    Completed { s3_path: String },
}

/// A callback invoked for each [`UploadEvent`]. Callbacks may be invoked from
/// any task and must be cheap — emit to a channel or bounded buffer and do
/// heavy work elsewhere.
pub type ProgressCallback = Arc<dyn Fn(UploadEvent) + Send + Sync + 'static>;