aws_credential_types/
attributes.rs1#[derive(Clone, Debug, Eq, PartialEq)]
10pub struct AccountId {
11 inner: String,
12}
13
14impl AccountId {
15 pub fn as_str(&self) -> &str {
17 &self.inner
18 }
19}
20
21impl<T> From<T> for AccountId
22where
23 T: Into<String>,
24{
25 fn from(value: T) -> Self {
26 Self {
27 inner: value.into(),
28 }
29 }
30}
31
32#[cfg(test)]
33mod tests {
34 use super::*;
35
36 #[test]
37 fn account_id_creation() {
38 let expected = "012345678901";
39 assert_eq!(expected, AccountId::from(expected).as_str());
40 assert_eq!(expected, AccountId::from(String::from(expected)).as_str());
41 }
42}