Crates.io | drteeth |
lib.rs | drteeth |
version | 0.2.1 |
source | src |
created_at | 2022-11-23 14:32:04.031502 |
updated_at | 2023-01-25 13:40:24.865179 |
description | Low-complexity web technology user interface library for desktop apps |
homepage | https://git.sr.ht/~djarb/drteeth |
repository | https://git.sr.ht/~djarb/drteeth |
max_upload_size | |
id | 721657 |
size | 183,171 |
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.
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.
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.