@@ -167,15 +167,20 @@ impl Pixbuf {
167
167
168
168
#[ doc( alias = "gdk_pixbuf_new_from_stream" ) ]
169
169
#[ doc( alias = "new_from_stream" ) ]
170
- pub fn from_stream (
170
+ pub fn from_stream < ' a , P : IsA < gio :: Cancellable > > (
171
171
stream : & impl IsA < gio:: InputStream > ,
172
- cancellable : Option < & impl IsA < gio :: Cancellable > > ,
172
+ cancellable : impl Into < Option < & ' a P > > ,
173
173
) -> Result < Pixbuf , glib:: Error > {
174
174
unsafe {
175
175
let mut error = std:: ptr:: null_mut ( ) ;
176
176
let ret = ffi:: gdk_pixbuf_new_from_stream (
177
177
stream. as_ref ( ) . to_glib_none ( ) . 0 ,
178
- cancellable. map ( |p| p. as_ref ( ) ) . to_glib_none ( ) . 0 ,
178
+ cancellable
179
+ . into ( )
180
+ . as_ref ( )
181
+ . map ( |p| p. as_ref ( ) )
182
+ . to_glib_none ( )
183
+ . 0 ,
179
184
& mut error,
180
185
) ;
181
186
if error. is_null ( ) {
@@ -188,12 +193,12 @@ impl Pixbuf {
188
193
189
194
#[ doc( alias = "gdk_pixbuf_new_from_stream_at_scale" ) ]
190
195
#[ doc( alias = "new_from_stream_at_scale" ) ]
191
- pub fn from_stream_at_scale (
196
+ pub fn from_stream_at_scale < ' a , P : IsA < gio :: Cancellable > > (
192
197
stream : & impl IsA < gio:: InputStream > ,
193
198
width : i32 ,
194
199
height : i32 ,
195
200
preserve_aspect_ratio : bool ,
196
- cancellable : Option < & impl IsA < gio :: Cancellable > > ,
201
+ cancellable : impl Into < Option < & ' a P > > ,
197
202
) -> Result < Pixbuf , glib:: Error > {
198
203
unsafe {
199
204
let mut error = std:: ptr:: null_mut ( ) ;
@@ -202,7 +207,12 @@ impl Pixbuf {
202
207
width,
203
208
height,
204
209
preserve_aspect_ratio. into_glib ( ) ,
205
- cancellable. map ( |p| p. as_ref ( ) ) . to_glib_none ( ) . 0 ,
210
+ cancellable
211
+ . into ( )
212
+ . as_ref ( )
213
+ . map ( |p| p. as_ref ( ) )
214
+ . to_glib_none ( )
215
+ . 0 ,
206
216
& mut error,
207
217
) ;
208
218
if error. is_null ( ) {
@@ -534,17 +544,17 @@ impl Pixbuf {
534
544
}
535
545
536
546
//#[doc(alias = "gdk_pixbuf_save")]
537
- //pub fn save(&self, filename: impl AsRef<std::path::Path>, type_: &str, error: Option<&mut glib::Error>, : /*Unimplemented*/Basic: VarArgs) -> bool {
547
+ //pub fn save<'a> (&self, filename: impl AsRef<std::path::Path>, type_: &str, error: impl Into< Option<&'a mut glib::Error> >, : /*Unimplemented*/Basic: VarArgs) -> bool {
538
548
// unsafe { TODO: call ffi:gdk_pixbuf_save() }
539
549
//}
540
550
541
551
//#[doc(alias = "gdk_pixbuf_save_to_buffer")]
542
- //pub fn save_to_buffer(&self, type_: &str, error: Option<&mut glib::Error>, : /*Unimplemented*/Basic: VarArgs) -> Option<Vec<u8>> {
552
+ //pub fn save_to_buffer<'a> (&self, type_: &str, error: impl Into< Option<&'a mut glib::Error> >, : /*Unimplemented*/Basic: VarArgs) -> Option<Vec<u8>> {
543
553
// unsafe { TODO: call ffi:gdk_pixbuf_save_to_buffer() }
544
554
//}
545
555
546
556
//#[doc(alias = "gdk_pixbuf_save_to_callback")]
547
- //pub fn save_to_callback<P: FnMut(&[u8], usize, &glib::Error) -> bool>(&self, save_func: P, type_: &str, error: Option<&mut glib::Error>, : /*Unimplemented*/Basic: VarArgs) -> bool {
557
+ //pub fn save_to_callback<'a, P: FnMut(&[u8], usize, &glib::Error) -> bool>(&self, save_func: P, type_: &str, error: impl Into< Option<&'a mut glib::Error> >, : /*Unimplemented*/Basic: VarArgs) -> bool {
548
558
// unsafe { TODO: call ffi:gdk_pixbuf_save_to_callback() }
549
559
//}
550
560
@@ -554,12 +564,12 @@ impl Pixbuf {
554
564
//}
555
565
556
566
//#[doc(alias = "gdk_pixbuf_save_to_stream")]
557
- //pub fn save_to_stream(&self, stream: &impl IsA<gio::OutputStream>, type_: &str, cancellable: Option<&impl IsA<gio::Cancellable >>, error: Option<&mut glib::Error>, : /*Unimplemented*/Basic: VarArgs) -> bool {
567
+ //pub fn save_to_stream<'a, P: IsA<gio::Cancellable>> (&self, stream: &impl IsA<gio::OutputStream>, type_: &str, cancellable: impl Into< Option<&'a P >>, error: impl Into< Option<&'a mut glib::Error> >, : /*Unimplemented*/Basic: VarArgs) -> bool {
558
568
// unsafe { TODO: call ffi:gdk_pixbuf_save_to_stream() }
559
569
//}
560
570
561
571
//#[doc(alias = "gdk_pixbuf_save_to_stream_async")]
562
- //pub fn save_to_stream_async<P: FnOnce(Result<(), glib::Error>) + 'static>(&self, stream: &impl IsA<gio::OutputStream>, type_: &str, cancellable: Option<&impl IsA<gio::Cancellable >>, callback: P , : /*Unimplemented*/Basic: VarArgs) {
572
+ //pub fn save_to_stream_async<'a, P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), glib::Error>) + 'static>(&self, stream: &impl IsA<gio::OutputStream>, type_: &str, cancellable: impl Into< Option<&'a P >>, callback: Q , : /*Unimplemented*/Basic: VarArgs) {
563
573
// unsafe { TODO: call ffi:gdk_pixbuf_save_to_stream_async() }
564
574
//}
565
575
0 commit comments