puerto 0.9.0

Puerto — Rust full-stack DDD framework CLI. Scaffolds Clean Architecture projects with auto-wired DI, SQLx support, and zero manual wiring. Formerly puerto-framework.
1
2
3
4
5
6
7
8
9
10
11
12
use poem::http::StatusCode;
use poem_openapi::{Object, payload::Json};

#[derive(Object, Debug)]
pub struct ErrorResponse {
    pub name: String,
    pub message: String,
}

pub trait IntoErrorResponse {
    fn into_error_response(self) -> (StatusCode, Json<ErrorResponse>);
}