Open kennykerr opened 4 years ago
Closing this old issue - doesn't seem to be much demand for such API support. Let me know if you have thoughts to the contrary. 😊
Reopening as there's renewed demand for WinRT type system support. Doing what I described here https://github.com/microsoft/windows-rs/issues/2310#issuecomment-1406625343 should be a little easier with a stock implementation.
I think that IReference<T>
support can be limited to "optional" behavior rather than the double mean used by Xaml and .NET for polymorphic value types. That simplifies the implementation and lets us treat IReference<T>
more uniformly in Rust as semantically equivalent to Option<T>
. The bindings can then be simplified to model IReference<T>
properties as OptionParam<IReference<T>>
and Result<IReference<T>>
respectively.
WinRT uses
IReference<T>
parameter and field types to indicate that a given argument/value is optional. This should be expressed in Rust usingOption<T>
. In particular, we should addParam
specializations (as we do for strings) forIReference<T>
input parameters to allow parameters to either acceptT
orNone
.This builds on #92.