@@ -167,15 +167,20 @@ impl Pixbuf {
167167
168168 #[ doc( alias = "gdk_pixbuf_new_from_stream" ) ]
169169 #[ doc( alias = "new_from_stream" ) ]
170- pub fn from_stream (
170+ pub fn from_stream < ' a , P : IsA < gio :: Cancellable > > (
171171 stream : & impl IsA < gio:: InputStream > ,
172- cancellable : Option < & impl IsA < gio :: Cancellable > > ,
172+ cancellable : impl Into < Option < & ' a P > > ,
173173 ) -> Result < Pixbuf , glib:: Error > {
174174 unsafe {
175175 let mut error = std:: ptr:: null_mut ( ) ;
176176 let ret = ffi:: gdk_pixbuf_new_from_stream (
177177 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 ,
179184 & mut error,
180185 ) ;
181186 if error. is_null ( ) {
@@ -188,12 +193,12 @@ impl Pixbuf {
188193
189194 #[ doc( alias = "gdk_pixbuf_new_from_stream_at_scale" ) ]
190195 #[ 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 > > (
192197 stream : & impl IsA < gio:: InputStream > ,
193198 width : i32 ,
194199 height : i32 ,
195200 preserve_aspect_ratio : bool ,
196- cancellable : Option < & impl IsA < gio :: Cancellable > > ,
201+ cancellable : impl Into < Option < & ' a P > > ,
197202 ) -> Result < Pixbuf , glib:: Error > {
198203 unsafe {
199204 let mut error = std:: ptr:: null_mut ( ) ;
@@ -202,7 +207,12 @@ impl Pixbuf {
202207 width,
203208 height,
204209 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 ,
206216 & mut error,
207217 ) ;
208218 if error. is_null ( ) {
@@ -534,17 +544,17 @@ impl Pixbuf {
534544 }
535545
536546 //#[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 {
538548 // unsafe { TODO: call ffi:gdk_pixbuf_save() }
539549 //}
540550
541551 //#[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>> {
543553 // unsafe { TODO: call ffi:gdk_pixbuf_save_to_buffer() }
544554 //}
545555
546556 //#[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 {
548558 // unsafe { TODO: call ffi:gdk_pixbuf_save_to_callback() }
549559 //}
550560
@@ -554,12 +564,12 @@ impl Pixbuf {
554564 //}
555565
556566 //#[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 {
558568 // unsafe { TODO: call ffi:gdk_pixbuf_save_to_stream() }
559569 //}
560570
561571 //#[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) {
563573 // unsafe { TODO: call ffi:gdk_pixbuf_save_to_stream_async() }
564574 //}
565575
0 commit comments