Serializers
Control JSON shape with a derive.
#[derive(Serializer)] turns a model (or any struct) into JSON with per-field control: read_only, write_only, source, skip. ModelSerializer round-trips model rows + validates input.
#[derive(Serializer)]
pub struct UserOut {
pub id: i64,
pub email: String,
#[serializer(write_only)] pub password: String,
}