I've been doing something very similar in Rust recently using Askama or Maud for templates (components), optionally with Axum to include a server in the binary.
The author mentions wanting to colocate templates with logic, Maud allows much tighter/automatic integration in this regard.
This approach also synergizes almost perfectly with HTMX.