use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct Masquerade {
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<String>,
}
impl Masquerade {
pub fn new(name: impl Into<String>, avatar: impl Into<String>) -> Self {
Self {
name: Some(name.into()),
avatar: Some(avatar.into()),
}
}
pub fn name(name: impl Into<String>) -> Self {
Self {
name: Some(name.into()),
avatar: None,
}
}
pub fn avatar(avatar: impl Into<String>) -> Self {
Self {
name: None,
avatar: Some(avatar.into()),
}
}
}