3 unstable releases
0.2.1 | Jan 25, 2023 |
---|---|
0.2.0 | Nov 30, 2022 |
0.1.0 | Nov 23, 2022 |
#834 in GUI
53KB
149 lines
Build desktop Rust apps in a snap
Using Drteeth, you pick your favorite async web server framework and your favorite web frontend tools, and use them to build a desktop app. From the programmer’s point of view everything works exactly the same as if it were split up into a web server and a browser client. From a user’s point of view, it’s just a single small, fast app like any other.
Drteeth can use tokio, async-std, or smol as its async runtime, and any web server compatible with any of them will work as the framework for your program logic.
Drteeth uses Wry to open your target platform’s native webview, so there’s no need to bundle a full web browser into the binary. Drteeth apps are small, fast, and portable.
Also a server
Programs using Drteeth are in fact actual web apps, so they can be accessed remotely if (and only if) they are configured to open a port on a non-loopback network interface. Similarly, the server part of a Drteeth program can provide an API which can be used by “plugin” programs to interface with it.
Super simple
There’s only one function call required to launch a Drteeth program. You tell it the title to use for the window, how to run the async web server, and which URL to start on.
Here’s the Drteeth invocation from the Axum example. We’ve left out the setup for the Axum server itself here, but this is all that’s needed to turn that server into a desktop app:
drteeth::launch("Basic Demo", addr, async move {
Server::from_tcp(ear)
.unwrap()
.serve(app.into_make_service())
.with_graceful_shutdown(async {
shutdown_rx.await.ok();
})
.await
.unwrap();
})
.unwrap();
Check out the examples to see how to use Drteeth with Axum, Tide, and Trillium.
Detailed API documentation is available on docs.rs.
Pairs well with…
Dependencies
~9–51MB
~749K SLoC