@@ -16,7 +16,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
16
16
fn read_line < P : IsA < Cancellable > > (
17
17
& self ,
18
18
cancellable : Option < & P > ,
19
- ) -> Result < Vec < u8 > , glib:: Error > {
19
+ ) -> Result < glib :: collections :: Slice < u8 > , glib:: Error > {
20
20
unsafe {
21
21
let mut length = mem:: MaybeUninit :: uninit ( ) ;
22
22
let mut error = ptr:: null_mut ( ) ;
@@ -36,7 +36,10 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
36
36
}
37
37
38
38
#[ doc( alias = "g_data_input_stream_read_line_async" ) ]
39
- fn read_line_async < P : IsA < Cancellable > , Q : FnOnce ( Result < Vec < u8 > , glib:: Error > ) + ' static > (
39
+ fn read_line_async <
40
+ P : IsA < Cancellable > ,
41
+ Q : FnOnce ( Result < glib:: collections:: Slice < u8 > , glib:: Error > ) + ' static ,
42
+ > (
40
43
& self ,
41
44
io_priority : glib:: Priority ,
42
45
cancellable : Option < & P > ,
@@ -55,7 +58,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
55
58
let user_data: Box_ < glib:: thread_guard:: ThreadGuard < Q > > =
56
59
Box_ :: new ( glib:: thread_guard:: ThreadGuard :: new ( callback) ) ;
57
60
unsafe extern "C" fn read_line_async_trampoline <
58
- Q : FnOnce ( Result < Vec < u8 > , glib:: Error > ) + ' static ,
61
+ Q : FnOnce ( Result < glib :: collections :: Slice < u8 > , glib:: Error > ) + ' static ,
59
62
> (
60
63
_source_object : * mut glib:: gobject_ffi:: GObject ,
61
64
res : * mut ffi:: GAsyncResult ,
@@ -95,7 +98,12 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
95
98
fn read_line_future (
96
99
& self ,
97
100
io_priority : glib:: Priority ,
98
- ) -> Pin < Box_ < dyn std:: future:: Future < Output = Result < Vec < u8 > , glib:: Error > > + ' static > > {
101
+ ) -> Pin <
102
+ Box_ <
103
+ dyn std:: future:: Future < Output = Result < glib:: collections:: Slice < u8 > , glib:: Error > >
104
+ + ' static ,
105
+ > ,
106
+ > {
99
107
Box_ :: pin ( crate :: GioFuture :: new (
100
108
self ,
101
109
move |obj, cancellable, send| {
@@ -204,7 +212,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
204
212
& self ,
205
213
stop_chars : & [ u8 ] ,
206
214
cancellable : Option < & P > ,
207
- ) -> Result < Vec < u8 > , glib:: Error > {
215
+ ) -> Result < glib :: collections :: Slice < u8 > , glib:: Error > {
208
216
let stop_chars_len = stop_chars. len ( ) as isize ;
209
217
unsafe {
210
218
let mut error = ptr:: null_mut ( ) ;
@@ -220,7 +228,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
220
228
if error. is_null ( ) {
221
229
let length = length. assume_init ( ) ;
222
230
Ok ( FromGlibContainer :: from_glib_full_num (
223
- ret as * const _ ,
231
+ ret as * mut u8 ,
224
232
length,
225
233
) )
226
234
} else {
@@ -230,7 +238,10 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
230
238
}
231
239
232
240
#[ doc( alias = "g_data_input_stream_read_upto_async" ) ]
233
- fn read_upto_async < P : IsA < Cancellable > , Q : FnOnce ( Result < Vec < u8 > , glib:: Error > ) + ' static > (
241
+ fn read_upto_async <
242
+ P : IsA < Cancellable > ,
243
+ Q : FnOnce ( Result < glib:: collections:: Slice < u8 > , glib:: Error > ) + ' static ,
244
+ > (
234
245
& self ,
235
246
stop_chars : & [ u8 ] ,
236
247
io_priority : glib:: Priority ,
@@ -251,7 +262,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
251
262
let user_data: Box_ < glib:: thread_guard:: ThreadGuard < Q > > =
252
263
Box_ :: new ( glib:: thread_guard:: ThreadGuard :: new ( callback) ) ;
253
264
unsafe extern "C" fn read_upto_async_trampoline <
254
- Q : FnOnce ( Result < Vec < u8 > , glib:: Error > ) + ' static ,
265
+ Q : FnOnce ( Result < glib :: collections :: Slice < u8 > , glib:: Error > ) + ' static ,
255
266
> (
256
267
_source_object : * mut glib:: gobject_ffi:: GObject ,
257
268
res : * mut ffi:: GAsyncResult ,
@@ -268,7 +279,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
268
279
let result = if error. is_null ( ) {
269
280
let length = length. assume_init ( ) ;
270
281
Ok ( FromGlibContainer :: from_glib_full_num (
271
- ret as * const _ ,
282
+ ret as * mut u8 ,
272
283
length,
273
284
) )
274
285
} else {
@@ -297,7 +308,12 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
297
308
& self ,
298
309
stop_chars : & [ u8 ] ,
299
310
io_priority : glib:: Priority ,
300
- ) -> Pin < Box_ < dyn std:: future:: Future < Output = Result < Vec < u8 > , glib:: Error > > + ' static > > {
311
+ ) -> Pin <
312
+ Box_ <
313
+ dyn std:: future:: Future < Output = Result < glib:: collections:: Slice < u8 > , glib:: Error > >
314
+ + ' static ,
315
+ > ,
316
+ > {
301
317
let stop_chars = Vec :: from ( stop_chars) ;
302
318
Box_ :: pin ( crate :: GioFuture :: new (
303
319
self ,
0 commit comments