require Priority, Cancellable arguments, remove extra members

This commit is contained in:
yggverse 2024-12-01 04:35:19 +02:00
parent 2df9f36599
commit 8f910672e2
7 changed files with 30 additions and 102 deletions

View file

@ -15,7 +15,7 @@ use glib::{object::IsA, Bytes, Priority};
/// * calculate bytes processed on chunk load
pub fn from_stream_async(
base_io_stream: impl IsA<IOStream>,
cancelable: Option<Cancellable>,
cancelable: Cancellable,
priority: Priority,
bytes_in_chunk: usize,
bytes_total_limit: usize,
@ -38,7 +38,7 @@ pub fn from_stream_async(
pub fn read_all_from_stream_async(
memory_input_stream: MemoryInputStream,
base_io_stream: impl IsA<IOStream>,
cancelable: Option<Cancellable>,
cancelable: Cancellable,
priority: Priority,
bytes: (usize, usize, usize),
callback: (
@ -52,7 +52,7 @@ pub fn read_all_from_stream_async(
base_io_stream.input_stream().read_bytes_async(
bytes_in_chunk,
priority,
cancelable.clone().as_ref(),
Some(&cancelable.clone()),
move |result| match result {
Ok(bytes) => {
// Update bytes total