gemini-2.5-flash| input-price: 0.3 output-price: 2.5 max-context-length: 128_000 (cost: $0.02) Β· Anfrage: 2025-09-23T18:45:44.700243
Generated by rs-summarizer Version unbekannt
Abstract:
In this video, the speaker embarks on an exploratory journey into building a web application using Rust's axum framework and askama templating engine, aiming to recreate elements of a previous Go-based HTMX project. The setup of the axum server, integration with tokyo for async operations, and dependency management with cargo are detailed. The core challenge revolves around askama's templating paradigm, specifically the struggle to achieve a compositional, fragment-based templating style (similar to Go's named blocks within a single file) versus askama's reliance on file-per-component or inheritance. While appreciating Rust's strong type safety and clean server code, the speaker expresses significant frustration with askama's templating workflow and the lengthy compile times, ultimately deeming the askama experiment a "fail" for his desired workflow, and plans to explore go temple or other Rust templating options next. Personal anecdotes about daily routines, fitness, and life optimizations are interwoven throughout the technical discussion.
Exploring Axum and Askama: A Rust Web Development Experiment
axum, a Rust web framework, aiming to build a project previously done in Go.axum is built on the Tower abstraction, a library for robust networking clients and servers, designed around a request-response pattern and protocol agnostic. It integrates with Tokyo (async runtime), Hyper (server), and Tower (middleware).axum, tokyo (with "full" features), clap (for CLI arguments), serde (for serialization/deserialization), askama (templating engine), and rand.axum setup with a router, get handler, binding to an address, and serving as a hyper service.askama for HTML templating, appreciating its type safety and automatic conversion of structs to HTML. However, he quickly encounters difficulties with askama's macro system and structure, desiring a more compositional approach (like Go's named template blocks within a single file) rather than askama's default of defining templates in separate files or relying on inheritance.rand, lazy_static) for functionalities often standard in other languages, describing it as "busy work" that can hinder teaching.axum server and askama templates, attempting to define query parameters, handlers, and render HTML.shuttle.rs for easy deployment, aiming for a "creamy smooth" website experience. He prefers HTMX's server-driven actions over client-side frameworks like React, criticizing React's rendering model and mixing of templating with data fetching.askama, but hits limitations with scope and the requirement for macros to be at the "top level" or imported, leading to excessive file splitting.lazy_static and tokio::sync::Mutex to manage shared, mutable state (a vector of Timing structs) within the axum application.askama experiment as a "fail" for his desired workflow due to its rigid templating structure that forces extensive file splitting instead of allowing multiple render fragments within a single file.askama's issues, he praises axum itself for its clean code and ease of use, making the Rust web framework part a "pass."go temple next for its type safety and speed, and potentially other Rust templating engines like sailfish or handlebars.