puerto 0.27.0

Puerto: la CLI de un framework full-stack DDD en Rust. Genera proyectos con Clean Architecture, la inyección de dependencias cableada sola y soporte de SQLx, sin cablear nada a mano. Antes, puerto-framework.
{# Un objeto valor que envuelve un primitivo. `error` es su tipo de error; `invalid`, el valor de
   error completo (`ErrorProducto::NombreInvalido`, `ErrorEmail::Invalido`). #}
{% macro value_object(vo, inner, error, invalid) %}{% if inner == "String" %}#[derive(Debug, Clone, PartialEq)]
pub struct {{ vo }} {
    valor: String,
}

impl {{ vo }} {
    pub fn new(valor: String) -> Result<Self, {{ error }}> {
        let recortado = valor.trim().to_string();
        if recortado.is_empty() {
            return Err({{ invalid }});
        }
        Ok(Self { valor: recortado })
    }

    pub fn valor(&self) -> &str {
        &self.valor
    }
}{% else %}#[derive(Debug, Clone{% if inner != "DateTime<Utc>" %}, Copy{% endif %}, PartialEq)]
pub struct {{ vo }}({{ inner }});

impl {{ vo }} {
    pub fn new(valor: {{ inner }}) -> Result<Self, {{ error }}> {
        Ok(Self(valor))
    }

    pub fn valor(&self) -> {{ inner }} {
        self.0
    }
}{% endif %}{% endmacro value_object %}