mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
rename methods, change arguments order
This commit is contained in:
parent
4ee92645ca
commit
46483d1829
1 changed files with 11 additions and 11 deletions
|
|
@ -15,19 +15,19 @@ use glib::{object::IsA, Priority};
|
||||||
/// * calculate bytes processed on chunk load
|
/// * calculate bytes processed on chunk load
|
||||||
pub fn from_stream_async(
|
pub fn from_stream_async(
|
||||||
io_stream: impl IsA<IOStream>,
|
io_stream: impl IsA<IOStream>,
|
||||||
cancelable: Cancellable,
|
|
||||||
priority: Priority,
|
priority: Priority,
|
||||||
|
cancelable: Cancellable,
|
||||||
(chunk, limit): (usize, usize),
|
(chunk, limit): (usize, usize),
|
||||||
(on_chunk, on_complete): (
|
(on_chunk, on_complete): (
|
||||||
impl Fn(usize, usize) + 'static,
|
impl Fn(usize, usize) + 'static,
|
||||||
impl FnOnce(Result<(MemoryInputStream, usize), Error>) + 'static,
|
impl FnOnce(Result<(MemoryInputStream, usize), Error>) + 'static,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
move_all_from_stream_async(
|
for_memory_input_stream_async(
|
||||||
io_stream,
|
|
||||||
MemoryInputStream::new(),
|
MemoryInputStream::new(),
|
||||||
cancelable,
|
io_stream,
|
||||||
priority,
|
priority,
|
||||||
|
cancelable,
|
||||||
(chunk, limit, 0),
|
(chunk, limit, 0),
|
||||||
(on_chunk, on_complete),
|
(on_chunk, on_complete),
|
||||||
);
|
);
|
||||||
|
|
@ -36,11 +36,11 @@ pub fn from_stream_async(
|
||||||
/// Asynchronously move all bytes from [IOStream](https://docs.gtk.org/gio/class.IOStream.html)
|
/// Asynchronously move all bytes from [IOStream](https://docs.gtk.org/gio/class.IOStream.html)
|
||||||
/// to [MemoryInputStream](https://docs.gtk.org/gio/class.MemoryInputStream.html)
|
/// to [MemoryInputStream](https://docs.gtk.org/gio/class.MemoryInputStream.html)
|
||||||
/// * require `IOStream` reference to keep `Connection` active in async thread
|
/// * require `IOStream` reference to keep `Connection` active in async thread
|
||||||
pub fn move_all_from_stream_async(
|
pub fn for_memory_input_stream_async(
|
||||||
io_stream: impl IsA<IOStream>,
|
|
||||||
memory_input_stream: MemoryInputStream,
|
memory_input_stream: MemoryInputStream,
|
||||||
cancellable: Cancellable,
|
io_stream: impl IsA<IOStream>,
|
||||||
priority: Priority,
|
priority: Priority,
|
||||||
|
cancellable: Cancellable,
|
||||||
(chunk, limit, mut total): (usize, usize, usize),
|
(chunk, limit, mut total): (usize, usize, usize),
|
||||||
(on_chunk, on_complete): (
|
(on_chunk, on_complete): (
|
||||||
impl Fn(usize, usize) + 'static,
|
impl Fn(usize, usize) + 'static,
|
||||||
|
|
@ -67,14 +67,14 @@ pub fn move_all_from_stream_async(
|
||||||
memory_input_stream.add_bytes(&bytes);
|
memory_input_stream.add_bytes(&bytes);
|
||||||
|
|
||||||
// continue reading..
|
// continue reading..
|
||||||
move_all_from_stream_async(
|
for_memory_input_stream_async(
|
||||||
io_stream,
|
|
||||||
memory_input_stream,
|
memory_input_stream,
|
||||||
cancellable,
|
io_stream,
|
||||||
priority,
|
priority,
|
||||||
|
cancellable,
|
||||||
(chunk, limit, total),
|
(chunk, limit, total),
|
||||||
(on_chunk, on_complete),
|
(on_chunk, on_complete),
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
on_complete(Err(Error::InputStream(e)));
|
on_complete(Err(Error::InputStream(e)));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue