pub trait RenderAs<Format: ContentFormat> {
// Required method
fn render(&self) -> Result<(Vec<u8>, &'static str), String>;
}Expand description
Convert a domain type into bytes for a specific content format.
Implement this trait to teach the negotiation engine how to serialize your type as a particular format.
Blanket implementations are provided for:
RenderAs<JsonFormat>for anyT: serde::SerializeRenderAs<TextFormat>for anyT: Display