Skip to main content

negotiated

Function negotiated 

Source
pub fn negotiated<T, Formats>(
    value: T,
    accept: AcceptHeader,
) -> NegotiatedResponse<T, Formats>
Expand description

Wrap a domain value for content negotiation with the given Accept header.

§Example

async fn get_user(accept: AcceptHeader) -> NegotiatedResponse<User, (JsonFormat, TextFormat)> {
    negotiated(user, accept)
}