Urgent.News

What's breaking now, across thousands of outlets.

Tech

I wrote Ratiform to stop writing forms in Ratatui

Il problema: due campi vanno bene, tre iniziano a far male Chi ha scritto anche solo una TUI con Ratatui conosce la progressione. Il primo input è banale: uno String nello stato dell'app, un match sugli eventi tastiera per gestire inserimento e cancellazione, un widget Paragraph per disegnarlo. Forse solo cinque minuti di lavoro. Il secondo campo si scrive praticamente per copia-incolla del…

Translated from Italian Read in Italian

The article discusses the challenges of managing forms in a Rust application, specifically with the Ratatui library. As the number of fields increases, the code becomes more complex, with issues such as focus management, validation, and rendering. To address this, the author created a crate called `ratiform`, which provides a structured approach to form management. `ratiform` uses a generic type `T` to identify fields, allowing for type-safe and efficient management of form state.

The article demonstrates how to use `ratiform` to create a simple form with one or multiple fields, including text inputs, checkboxes, and select menus.

Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Gitea SSL with Apache as reverse proxy

We want to host a nice and secure container registry - to push docker images there and our kubernetes cluster would pull them from this registry. So came the idea to use the gitea over ssl.

  • Gitea container registry feature enables HTTPS access
  • Apache reverse proxy configured to point to Gitea on port 3000
  • SSL setup and virtual host creation for Gitea registry

More from Friday 11 September →