Skip to main content
pub struct FnDownloadListener<F1, F2, F3>
where
    F1: Fn(Vec<OperationResult>) + Send + Sync,
    F2: Fn(OperationResult) + Send + Sync,
    F3: Fn(Vec<String>) + Send + Sync,
/* private fields */

A simple download listener that wraps callback functions.

This provides a convenient way to create listeners using closures without implementing the full trait.

Example

Implementations

Source

impl<F1, F2, F3>FnDownloadListener<F1, F2, F3>
where F1: Fn(Vec<OperationResult>) + Send + Sync, F2: Fn(OperationResult) + Send + Sync, F3: Fn(Vec<String>) + Send + Sync,

Source

pub fn new(on_multi_part_complete: F1, on_part: F2, on_full: F3) -> Self

Creates a new function-based download listener.

Trait Implementations

Source

impl<F1, F2, F3>FileDownloadListener for FnDownloadListener<F1, F2, F3>
where F1: Fn(Vec<OperationResult>) + Send + Sync, F2: Fn(OperationResult) + Send + Sync, F3: Fn(Vec<String>) + Send + Sync,

Called when all parts of a multi-part download have been completed. Read more
Called whenever a single part of a multi-part download has been completed. Read more
Source

fn on_full_file_download(&self, file_names: Vec<String>)

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. Read more