Crate bui_backend [−] [src]
The operating principle is that the server runs an HTTP server (based on hyper) to which the browser connects. The initial page tells the browser to open a connection to a Server Sent Events endpoint and the server can subsequently push updates to the browser. Additionally, the server listens for POST callbacks on another endpoint. All data is encoded as JSON.
- Uses raii-change-tracker to ensure that server state changes are reactively sent to all connected frontends.
- To keep things simple, server state is shared with all connected clients.
- Session keys (per browser) and connection keys (per tab) are maintained and allow taking control of communication using pre-established event stream. (This is an "escape hatch" to break out of the bui-backend abstractions as required by some use cases.)
- Written in async style using futures-rs.
- Uses Serde JSON.
- Compile-time choice between bundling served files into executable (with
bundle_filesfeature) or reading files from disk (
Due to its nature, the program listens and responds to client connections from the network. If you expose your program to untrusted network connections, ensure that code within any callback handlers you write is safe when handling malicious input.
Error and result types.
Helpers for writing browser user interfaces (BUIs).
Implements a web server for a Browser User Interface (BUI).