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.

https://docs.rs/raw-window-handle/0.3.3/src/raw_window_handle/ios.rs.html#1-34

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.