Writing a library crate that includes both rust and slint? #4623
Replies: 3 comments 3 replies
-
We're working on refactoring the gstreamer example in this direction; I pushed it here and made a Draft PR: #4627 We haven't managed to resolve ownership and thread safety issues yet. We had to jump through some hoops with closures since most of Slint's types are code generated under names that would not be known to a library (and they don't implement trais exposing what we need either).
Does this seem like a promising approach? Maybe we should write this as a macro that spits out the code we already had working, despite not knowing what types it will actually be using. Crates can ship macros, and slint is macro based anyway. We're just new to writing rust macros. |
Beta Was this translation helpful? Give feedback.
-
Having library in rust is something we'd like to allow, but unfortunately this is not really supported right now. (Some workaround could be done with rust macro or such, but we need a better way.) |
Beta Was this translation helpful? Give feedback.
-
Hi! -- nonsense removed -- I started a new project in Rust within a workspace where I have 3 crates, one a library and the other two are bin projects. I thought I could create all my widgets in the library and use the one I needed in the bin projects. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to make a rust library crate that contains both slint and rust code, and is intended to be re-usable in multiple projects? Suppose you had some custom control for slint that you want to push to crates.io... i.e. a video streaming plugin or a slippy map plugin... is that currently feasible?
Beta Was this translation helpful? Give feedback.
All reactions