tailwag 0.3.0

This is the main crate for the Tailwag suite, an experimental framework for building batteries-included application prototypes.
Documentation
use tailwag::prelude::*;

#[tokio::main]
async fn main() {
    derive_magic! {
        #[views(("/filter_todos/{val}", filter_todos))]
        struct Todo {
            id: uuid::Uuid,
            title: String,
            description: String,
            due_date: chrono::NaiveDateTime,
            completed: bool,
        }
    }

    WebService::builder("Todo Service")
        .with_resource::<Todo>()
        .build_service()
        .run()
        .await
        .expect("Web service crashed.");

    pub async fn filter_todos(
        val: PathString,
        todos: PostgresDataProvider<Todo>,
    ) -> Vec<Todo> {
        let val = &*val;
        let query = todos
            .with_filter(|todo| todo.completed.eq(true) & todo.title.like(&format!("%{val}%")));
        query.execute().await.unwrap()
    }
}