rama_net/user/credentials/
proxy.rs1use core::fmt;
2
3use super::{Basic, Bearer};
4
5use rama_core::extensions::Extension;
6
7#[derive(Debug, Clone, Extension)]
8#[extension(tags(net, proxy))]
9pub struct DpiProxyCredential(pub ProxyCredential);
13
14#[derive(Debug, Clone, PartialEq, Eq)]
15pub enum ProxyCredential {
17 Basic(Basic),
19 Bearer(Bearer),
21}
22
23impl From<Basic> for ProxyCredential {
24 fn from(basic: Basic) -> Self {
25 Self::Basic(basic)
26 }
27}
28
29impl From<Bearer> for ProxyCredential {
30 fn from(bearer: Bearer) -> Self {
31 Self::Bearer(bearer)
32 }
33}
34
35impl fmt::Display for ProxyCredential {
36 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37 match self {
38 Self::Basic(basic) => basic.fmt(f),
39 Self::Bearer(bearer) => bearer.fmt(f),
40 }
41 }
42}