dingtalk_stream/
credential.rs1#[derive(Clone)]
5pub struct Credential {
6 pub client_id: String,
8 pub client_secret: String,
10}
11
12impl Credential {
13 pub fn new(client_id: impl Into<String>, client_secret: impl Into<String>) -> Self {
15 Self {
16 client_id: client_id.into(),
17 client_secret: client_secret.into(),
18 }
19 }
20}
21
22impl std::fmt::Debug for Credential {
23 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24 f.debug_struct("Credential")
25 .field("client_id", &self.client_id)
26 .field("client_secret", &"***")
27 .finish()
28 }
29}
30
31impl std::fmt::Display for Credential {
32 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33 write!(f, "Credential(client_id={})", self.client_id)
34 }
35}