1use zeroize::Zeroize;
2
3#[derive(Clone, Debug, Eq, PartialEq, Zeroize)]
5pub struct ApiKey(String);
6
7impl ApiKey {
8 pub const fn new() -> Self {
10 Self(String::new())
11 }
12
13 pub fn as_str(&self) -> &str {
15 self.0.as_str()
16 }
17}
18
19impl Default for ApiKey {
20 fn default() -> Self {
21 Self::new()
22 }
23}
24
25impl From<&str> for ApiKey {
26 fn from(val: &str) -> Self {
27 Self(val.into())
28 }
29}
30
31impl From<String> for ApiKey {
32 fn from(val: String) -> Self {
33 Self(val)
34 }
35}