pub struct ContentNegotiationConfig {
pub default_content_type: ContentType,
pub supported_types: Vec<ContentType>,
pub add_vary_header: bool,
pub converters: HashMap<ContentType, Arc<dyn Fn(&Value) -> Result<Vec<u8>, String> + Send + Sync>>,
}Expand description
Content negotiation configuration
Fields§
§default_content_type: ContentTypeDefault content type when negotiation fails
supported_types: Vec<ContentType>Supported content types in order of preference
add_vary_header: boolWhether to add Vary header
converters: HashMap<ContentType, Arc<dyn Fn(&Value) -> Result<Vec<u8>, String> + Send + Sync>>Custom converters for content types
Trait Implementations§
Source§impl Clone for ContentNegotiationConfig
impl Clone for ContentNegotiationConfig
Source§impl Debug for ContentNegotiationConfig
impl Debug for ContentNegotiationConfig
Auto Trait Implementations§
impl Freeze for ContentNegotiationConfig
impl !RefUnwindSafe for ContentNegotiationConfig
impl Send for ContentNegotiationConfig
impl Sync for ContentNegotiationConfig
impl Unpin for ContentNegotiationConfig
impl !UnwindSafe for ContentNegotiationConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more