diff options
| author | Glenn Smith <glenn@vector35.com> | 2025-04-24 14:46:37 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2025-04-25 13:43:01 -0400 |
| commit | 9262278979709181414664053523657355762707 (patch) | |
| tree | c472e0620b1fdfe3b3c9fd26c7cbf41425b27740 /rust/src | |
| parent | 4aac12b0e429fedb02a645e5eb82ca2d88902e25 (diff) | |
std::function<bool(size_t,size_t)> ==> ProgressFunction
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/download_provider.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/src/download_provider.rs b/rust/src/download_provider.rs index 1e61c87d..6dd349e7 100644 --- a/rust/src/download_provider.rs +++ b/rust/src/download_provider.rs @@ -76,13 +76,13 @@ unsafe impl CoreArrayProviderInner for DownloadProvider { pub struct DownloadInstanceOutputCallbacks { pub write: Option<Box<dyn FnMut(&[u8]) -> usize>>, - pub progress: Option<Box<dyn FnMut(u64, u64) -> bool>>, + pub progress: Option<Box<dyn FnMut(usize, usize) -> bool>>, } pub struct DownloadInstanceInputOutputCallbacks { pub read: Option<Box<dyn FnMut(&mut [u8]) -> Option<isize>>>, pub write: Option<Box<dyn FnMut(&[u8]) -> usize>>, - pub progress: Option<Box<dyn FnMut(u64, u64) -> bool>>, + pub progress: Option<Box<dyn FnMut(usize, usize) -> bool>>, } pub struct DownloadResponse { @@ -121,7 +121,7 @@ impl DownloadInstance { } } - unsafe extern "C" fn o_progress_callback(ctxt: *mut c_void, progress: u64, total: u64) -> bool { + unsafe extern "C" fn o_progress_callback(ctxt: *mut c_void, progress: usize, total: usize) -> bool { let callbacks = ctxt as *mut DownloadInstanceOutputCallbacks; if let Some(func) = &mut (*callbacks).progress { (func)(progress, total) @@ -186,7 +186,7 @@ impl DownloadInstance { } } - unsafe extern "C" fn i_progress_callback(ctxt: *mut c_void, progress: u64, total: u64) -> bool { + unsafe extern "C" fn i_progress_callback(ctxt: *mut c_void, progress: usize, total: usize) -> bool { let callbacks = ctxt as *mut DownloadInstanceInputOutputCallbacks; if let Some(func) = &mut (*callbacks).progress { (func)(progress, total) |
