1use std::fmt;
2
3#[derive(Clone, PartialEq, Eq, Hash)]
7pub struct AppCredentials {
8 appkey: String,
9 appsecret: String,
10}
11
12impl AppCredentials {
13 #[must_use]
15 pub fn new(appkey: impl Into<String>, appsecret: impl Into<String>) -> Self {
16 Self {
17 appkey: appkey.into(),
18 appsecret: appsecret.into(),
19 }
20 }
21
22 #[must_use]
24 pub fn appkey(&self) -> &str {
25 &self.appkey
26 }
27
28 #[must_use]
30 pub fn appsecret(&self) -> &str {
31 &self.appsecret
32 }
33}
34
35impl fmt::Debug for AppCredentials {
36 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37 f.debug_struct("AppCredentials")
38 .field("appkey", &self.appkey)
39 .field("appsecret", &"<redacted>")
40 .finish()
41 }
42}