You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently gir, would generate AsRef<T> for fundamental types as a replacement of IsA<T> that is used for objects/interfaces. The problem with using AsRef<T> is it causes problems when the param is passed by value instead of by reference, so having a still generic Option<impl AsRef<T>> would mean having to clone the param before calling into_glib_ptr()
That is sub-optimal and we should probably avoid using AsRef here; maybe an alternative would be to allow configuring a trait to be used for a fundamental type and it sub-types. For example fundamental_trait = "IsExpression or something like that.
Currently gir, would generate
AsRef<T>
for fundamental types as a replacement ofIsA<T>
that is used for objects/interfaces. The problem with usingAsRef<T>
is it causes problems when the param is passed by value instead of by reference, so having a still genericOption<impl AsRef<T>>
would mean having to clone the param before callinginto_glib_ptr()
That is sub-optimal and we should probably avoid using
AsRef
here; maybe an alternative would be to allow configuring a trait to be used for a fundamental type and it sub-types. For examplefundamental_trait = "IsExpression
or something like that.Needs more thinking though. Details can be found at https://github.com/gtk-rs/gir/pull/1413/files#r1044662046
The text was updated successfully, but these errors were encountered: