> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FileDownloadListener

> FileDownloadListener — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[filesystem](https://docs.kinetica.com/content/api/rust/filesystem/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/listeners.rs#L119-L145)&#x20;

<pre>`pub trait FileDownloadListener: Send + Sync {    // Required methods    fn on_multi_part_download_complete(&self, results: Vec<OperationResult>);    fn on_part_download(&self, result: OperationResult);    fn on_full_file_download(&self, file_names: Vec<String>);}`</pre>

Listener trait for file download progress callbacks.Implement this trait to receive notifications about download progress, including per-part completion for multi-part downloads.

## Example

```rust theme={null}
use gpudb_api::filesystem::{FileDownloadListener, OperationResult};

struct MyDownloadListener;

impl FileDownloadListener for MyDownloadListener {
    fn on_multi_part_download_complete(&self, results: Vec<OperationResult>) {
        println!("Multi-part download complete with {} parts", results.len());
    }

    fn on_part_download(&self, result: OperationResult) {
        if let Some(info) = &result.download_info {
            println!("Downloaded part {} of {}", info.download_part_number, info.total_parts);
        }
    }

    fn on_full_file_download(&self, file_names: Vec<String>) {
        println!("Full files downloaded: {file_names:?}");
    }
}
```

## Required Methods

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/listeners.rs#L125)
fn [on\_multi\_part\_download\_complete](#tymethod.on_multi_part_download_complete)(\&self, results: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[OperationResult](https://docs.kinetica.com/content/api/rust/filesystem/struct.OperationResult.md)>)

Called when all parts of a multi-part download have been completed.

##### Arguments

<ul>
  <li>`results` - List of results for each part of the download</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/listeners.rs#L134)
fn [on\_part\_download](#tymethod.on_part_download)(\&self, result: [OperationResult](https://docs.kinetica.com/content/api/rust/filesystem/struct.OperationResult.md))

Called whenever a single part of a multi-part download has been completed.This is useful for tracking progress during large file downloads.

##### Arguments

<ul>
  <li>`result` - Result of the part download</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/listeners.rs#L144)
fn [on\_full\_file\_download](#tymethod.on_full_file_download)(\&self, file\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>)

Called once per batch of whole files fetched in one request, with the KiFS names of those saved, when at least one was. A file skipped because it already existed locally and overwriting is off counts as saved.

##### Arguments

<ul>
  <li>`file_names` - The KiFS names of the files saved</li>
</ul>

## Dyn Compatibility

This trait is [dyn compatible](https://doc.rust-lang.org/1.98.1/reference/items/traits.html#dyn-compatibility).In older versions of Rust, dyn compatibility was called "object safety".

## Implementors

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/listeners.rs#L291-L295)
impl [FileDownloadListener](https://docs.kinetica.com/content/api/rust/filesystem/trait.FileDownloadListener.md) for [NoOpDownloadListener](https://docs.kinetica.com/content/api/rust/filesystem/struct.NoOpDownloadListener.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/listeners.rs#L252-L269)

### impl\<F1, F2, F3>[FileDownloadListener](https://docs.kinetica.com/content/api/rust/filesystem/trait.FileDownloadListener.md) for [FnDownloadListener](https://docs.kinetica.com/content/api/rust/filesystem/struct.FnDownloadListener.md)\<F1, F2, F3>&#xA;where F1: [Fn](https://doc.rust-lang.org/1.98.1/core/ops/function/trait.Fn.html)([Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[OperationResult](https://docs.kinetica.com/content/api/rust/filesystem/struct.OperationResult.md)>) + [Send](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html) + [Sync](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html), F2: [Fn](https://doc.rust-lang.org/1.98.1/core/ops/function/trait.Fn.html)([OperationResult](https://docs.kinetica.com/content/api/rust/filesystem/struct.OperationResult.md)) + [Send](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html) + [Sync](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html), F3: [Fn](https://doc.rust-lang.org/1.98.1/core/ops/function/trait.Fn.html)([Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>) + [Send](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html) + [Sync](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html),


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.