@@ -74,23 +74,19 @@ pub trait ContentProviderExt: 'static {
7474 fn storable_formats ( & self ) -> ContentFormats ;
7575
7676 #[ doc( alias = "gdk_content_provider_write_mime_type_async" ) ]
77- fn write_mime_type_async <
78- P : IsA < gio:: OutputStream > ,
79- Q : IsA < gio:: Cancellable > ,
80- R : FnOnce ( Result < ( ) , glib:: Error > ) + Send + ' static ,
81- > (
77+ fn write_mime_type_async < P : FnOnce ( Result < ( ) , glib:: Error > ) + Send + ' static > (
8278 & self ,
8379 mime_type : & str ,
84- stream : & P ,
80+ stream : & impl IsA < gio :: OutputStream > ,
8581 io_priority : glib:: Priority ,
86- cancellable : Option < & Q > ,
87- callback : R ,
82+ cancellable : Option < & impl IsA < gio :: Cancellable > > ,
83+ callback : P ,
8884 ) ;
8985
90- fn write_mime_type_async_future < P : IsA < gio :: OutputStream > + Clone + ' static > (
86+ fn write_mime_type_async_future (
9187 & self ,
9288 mime_type : & str ,
93- stream : & P ,
89+ stream : & ( impl IsA < gio :: OutputStream > + Clone + ' static ) ,
9490 io_priority : glib:: Priority ,
9591 ) -> Pin < Box_ < dyn std:: future:: Future < Output = Result < ( ) , glib:: Error > > + ' static > > ;
9692
@@ -127,21 +123,17 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
127123 }
128124 }
129125
130- fn write_mime_type_async <
131- P : IsA < gio:: OutputStream > ,
132- Q : IsA < gio:: Cancellable > ,
133- R : FnOnce ( Result < ( ) , glib:: Error > ) + Send + ' static ,
134- > (
126+ fn write_mime_type_async < P : FnOnce ( Result < ( ) , glib:: Error > ) + Send + ' static > (
135127 & self ,
136128 mime_type : & str ,
137- stream : & P ,
129+ stream : & impl IsA < gio :: OutputStream > ,
138130 io_priority : glib:: Priority ,
139- cancellable : Option < & Q > ,
140- callback : R ,
131+ cancellable : Option < & impl IsA < gio :: Cancellable > > ,
132+ callback : P ,
141133 ) {
142- let user_data: Box_ < R > = Box_ :: new ( callback) ;
134+ let user_data: Box_ < P > = Box_ :: new ( callback) ;
143135 unsafe extern "C" fn write_mime_type_async_trampoline <
144- R : FnOnce ( Result < ( ) , glib:: Error > ) + Send + ' static ,
136+ P : FnOnce ( Result < ( ) , glib:: Error > ) + Send + ' static ,
145137 > (
146138 _source_object : * mut glib:: gobject_ffi:: GObject ,
147139 res : * mut gio:: ffi:: GAsyncResult ,
@@ -158,10 +150,10 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
158150 } else {
159151 Err ( from_glib_full ( error) )
160152 } ;
161- let callback: Box_ < R > = Box_ :: from_raw ( user_data as * mut _ ) ;
153+ let callback: Box_ < P > = Box_ :: from_raw ( user_data as * mut _ ) ;
162154 callback ( result) ;
163155 }
164- let callback = write_mime_type_async_trampoline :: < R > ;
156+ let callback = write_mime_type_async_trampoline :: < P > ;
165157 unsafe {
166158 ffi:: gdk_content_provider_write_mime_type_async (
167159 self . as_ref ( ) . to_glib_none ( ) . 0 ,
@@ -175,10 +167,10 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
175167 }
176168 }
177169
178- fn write_mime_type_async_future < P : IsA < gio :: OutputStream > + Clone + ' static > (
170+ fn write_mime_type_async_future (
179171 & self ,
180172 mime_type : & str ,
181- stream : & P ,
173+ stream : & ( impl IsA < gio :: OutputStream > + Clone + ' static ) ,
182174 io_priority : glib:: Priority ,
183175 ) -> Pin < Box_ < dyn std:: future:: Future < Output = Result < ( ) , glib:: Error > > + ' static > > {
184176 let mime_type = String :: from ( mime_type) ;
@@ -201,12 +193,13 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
201193
202194 #[ doc( alias = "content-changed" ) ]
203195 fn connect_content_changed < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
204- unsafe extern "C" fn content_changed_trampoline < P , F : Fn ( & P ) + ' static > (
196+ unsafe extern "C" fn content_changed_trampoline <
197+ P : IsA < ContentProvider > ,
198+ F : Fn ( & P ) + ' static ,
199+ > (
205200 this : * mut ffi:: GdkContentProvider ,
206201 f : glib:: ffi:: gpointer ,
207- ) where
208- P : IsA < ContentProvider > ,
209- {
202+ ) {
210203 let f: & F = & * ( f as * const F ) ;
211204 f ( & ContentProvider :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
212205 }
@@ -225,13 +218,14 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
225218
226219 #[ doc( alias = "formats" ) ]
227220 fn connect_formats_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
228- unsafe extern "C" fn notify_formats_trampoline < P , F : Fn ( & P ) + ' static > (
221+ unsafe extern "C" fn notify_formats_trampoline <
222+ P : IsA < ContentProvider > ,
223+ F : Fn ( & P ) + ' static ,
224+ > (
229225 this : * mut ffi:: GdkContentProvider ,
230226 _param_spec : glib:: ffi:: gpointer ,
231227 f : glib:: ffi:: gpointer ,
232- ) where
233- P : IsA < ContentProvider > ,
234- {
228+ ) {
235229 let f: & F = & * ( f as * const F ) ;
236230 f ( & ContentProvider :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
237231 }
@@ -250,13 +244,14 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
250244
251245 #[ doc( alias = "storable-formats" ) ]
252246 fn connect_storable_formats_notify < F : Fn ( & Self ) + ' static > ( & self , f : F ) -> SignalHandlerId {
253- unsafe extern "C" fn notify_storable_formats_trampoline < P , F : Fn ( & P ) + ' static > (
247+ unsafe extern "C" fn notify_storable_formats_trampoline <
248+ P : IsA < ContentProvider > ,
249+ F : Fn ( & P ) + ' static ,
250+ > (
254251 this : * mut ffi:: GdkContentProvider ,
255252 _param_spec : glib:: ffi:: gpointer ,
256253 f : glib:: ffi:: gpointer ,
257- ) where
258- P : IsA < ContentProvider > ,
259- {
254+ ) {
260255 let f: & F = & * ( f as * const F ) ;
261256 f ( & ContentProvider :: from_glib_borrow ( this) . unsafe_cast_ref ( ) )
262257 }
0 commit comments