pub trait NegotiateFormats<T> {
// Required methods
fn supported_types() -> Vec<&'static str>;
fn negotiate_and_render(
value: &T,
accept: Option<&str>,
) -> Result<(Vec<u8>, &'static str), String>;
}Expand description
Select the best format from a tuple of formats based on the Accept header
and render the domain value.
Implemented for format tuples of arities 1 through 6 via macro.
Required Methods§
Sourcefn supported_types() -> Vec<&'static str>
fn supported_types() -> Vec<&'static str>
All supported content types, in preference order.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.