Expand description
§WebRust - Python-like Rust for Web Applications
WebRust brings Python’s ergonomic syntax to Rust, enabling rapid development of web-based GUI applications with zero runtime overhead.
§SQL Support (Optional)
Enable SQL analytics with the sql feature:
[dependencies]
webrust = { version = "1.3.0", features = ["sql"] }Then use SQL queries:
ⓘ
use webrust::prelude::*;
#[gui]
fn main() {
query("SELECT * FROM generate_series(1, 10) AS t(x)");
}Note: The sql feature adds DuckDB (~5-10 min first compile).
Without it, WebRust compiles in ~30 seconds.
§Modules
io- Input/output operations: styled printing, user input, GUI serveriter- Python-like iteration: ranges, enumerate, comprehensionsviz- Data visualization: tables, charts, string methodsgraphic- Turtle graphics and object animationslayout- Grid layouts and coordinate systemsdb- SQL queries with DuckDB (requiressqlfeature)text- String manipulation utilitiesprelude- Re-exports commonly used items
§Core Features
- F-string interpolation:
println("Value: {x}, Result: {x * 2}") - Python-like ranges:
0.to(10),'a'.to('z'),0.to(100).by(5) - Comprehensions:
.when(predicate).then(mapper)for filtering and mapping - Interactive charts: Line, bar, pie, radar, and more with ECharts
- Smart tables: Automatic formatting from any serializable data
- SQL analytics (optional): DuckDB integration with streaming HTML table output
- LaTeX rendering: Mathematical expressions with MathJax
- Turtle graphics: Visual programming with animations
- Styled output: Colors, borders, alignment, positioning
The #[gui] attribute macro transforms any function into a web application
with automatic server setup and browser launch.
Re-exports§
Modules§
- db
- Module
db— Intégration SQL (DuckDB) pour WebRust - graphic
- Visual Programming with Turtle Graphics
- io
- I/O & GUI System
- iter
- Python-like Iteration Utilities
- layout
- Layout System - Grids and Coordinate Modes
- math
- Mathematical Functions
- prelude
- text
- Text Manipulation Utilities
- viz
- Data Structures and Interactive Visualization