1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use headers::www_authenticate::Challenge; use super::AuthenticationError; pub trait ExtractorConfig { type Inner: Challenge; fn into_inner(self) -> Self::Inner; } impl<T> From<T> for AuthenticationError<<T as ExtractorConfig>::Inner> where T: ExtractorConfig { fn from(config: T) -> Self { AuthenticationError::new(config.into_inner()) } }