No, I'm thinking more like you could define a stru...
# rust-htmx
a
No, I'm thinking more like you could define a struct to represent the data required for a particular html partial. Then all an htmx-serving route needs to do is create or retrieve the struct (from some combination of queries & processing on the backend), then serialize to html for the response. Eg in the typical 'todo' list app, the list view route would just be returning a retrieved
Vec<Todo>
(or whatever), but run through serde for the html response. Of course you'd need more boilerplate in there (containing divs, css classes and the like), which would be part of the custom serializer's configuration. Not thought through, as I say, so it could be a non-starter. But I might have a play with the concept myself.
2 Views