contextfree / winrt-rust

Use and (eventually) make Windows Runtime APIs with Rust
Apache License 2.0
142 stars 10 forks source link

Add RtActivatable::can_be_registered method #87

Open GuillaumeGomez opened 4 years ago

GuillaumeGomez commented 4 years ago

I get a panic at runtime(!) in https://github.com/GuillaumeGomez/sysinfo/pull/287 because we can't check beforehand if we can use an interface or not. I think this is not great and added this method to allow me to check so I can avoid the panic.

This is just an example, if you have a better solution, I'll all for it!

Boddlnagg commented 4 years ago

I'm sorry that I didn't answer earlier, but the reason is that I'm currently not actively developing this project because https://kennykerr.ca/2020/02/22/rust-winrt-coming-soon/ is a thing.

In principle, this PR looks good and I could as well just merge it, but I don't know if that would help anyone if I don't also eventually make a new release, which I'm currently not planning to do.

GuillaumeGomez commented 4 years ago

No problem, if the issue is solved in the long run, I'm fine with it. But being able to check if you can use something beforehand to prevent unwanted panics is a must have for me.