Add ID type for account

This commit is contained in:
D. Scott Boggs 2023-01-09 07:44:54 -05:00 committed by Scott Boggs
parent 97ae0973c3
commit 547d994d13
1 changed files with 12 additions and 1 deletions

View File

@ -30,7 +30,7 @@ pub struct Account {
/// URL to the header static image (gif).
pub header_static: String,
/// The ID of the account.
pub id: String,
pub id: AccountId,
/// Boolean for when the account cannot be followed without waiting for
/// approval first.
pub locked: bool,
@ -54,6 +54,17 @@ pub struct Account {
pub bot: Option<bool>,
}
/// Wrapper type for a account ID string
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(transparent)]
pub struct AccountId(String);
impl AsRef<str> for AccountId {
fn as_ref(&self) -> &str {
&self.0
}
}
/// A single name: value pair from a user's profile
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct MetadataField {