Skip to main content

download_object

Function download_object 

Source
pub async fn download_object<E, C>(
    client: Arc<Client>,
    bucket: BucketId,
    key: String,
    dest_path: PathBuf,
    request_id: String,
    channel: &E,
    registry: TransferRegistryHandle,
    lock_registry: Arc<LockRegistry>,
    cancel_rx: Receiver<()>,
    profile_id: ProfileId,
    lock_ttl_secs: u64,
    log: NotificationLogHandle,
    os_notifier: &OsNotifier<C>,
) -> Result<(), AppError>
Expand description

Stream-download key from bucket and write it atomically to dest_path.

§Parameters

  • client — authenticated S3 client for the profile’s region.
  • bucket — target bucket name.
  • key — S3 object key.
  • dest_path — local destination path (final, not .partial).
  • request_id — UUID v4 string from TransferRegistry::register.
  • channel — Tauri AppHandle or MockChannel for event emission.
  • registry — shared TransferRegistryHandle for state updates.
  • lock_registry — resource lock registry; this function acquires and releases the lock.
  • cancel_rx — oneshot receiver; resolved when the caller calls TransferRegistry::cancel.
  • profile_id — used to build the LockScope.
  • lock_ttl_secs — TTL for the acquired lock.
  • log — in-app notification log for terminal-state notifications.
  • os_notifier — OS notification bridge (settings-gated internally).