1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/// Credentials used for authentication. /// /// Supports Basic and Bearer authentication. #[derive(Debug, Clone)] pub enum Credentials { Bearer(String), Basic(String), } impl Credentials { pub fn to_auth_string(&self) -> String { match self { Self::Bearer(token) => format!("Bearer {}", token), Self::Basic(token) => format!("Basic {}", token), } } }