Question on rust, graphics, and calling from target platforms

Hey folks, I'm hoping to get some guidance as a newish rust user. My goal is to build a rust library which handles rendering 3d graphics and then attach that rendering library in a native component on various target platforms. All of the examples I have looked at using winit and similar crates so far have shown how to e.g. set up an iOS app that is fully initialized and controlled by the rust code.

Is there a way to do something like linking to such a rust library from a swift application and then calling in via FFI to get the rust code to render into a UIView?

In the case of wgpu-rs, could I build a custom struct that implements HasRawWindowHandle and builds one of these using raw points passed in from swift? wgpu-rs doesn't seem to care about the source of those pointers, only that it can get them.

It seems like it could be fine because I'm not actually interested in the event handling features that winit provides. I'm happy to implement interactions separately, I just want to be able to render stuff.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.