use serde::{Deserialize, Serialize};
#[derive(
Default,
Debug,
derive_more::Display,
derive_more::AsRef,
derive_more::FromStr,
derive_more::Into,
Clone,
PartialEq,
Eq,
Hash,
Serialize,
Deserialize,
)]
pub struct Symbol(String);
impl<T: AsRef<str>> PartialEq<T> for Symbol {
fn eq(&self, other: &T) -> bool {
self.0 == other.as_ref()
}
}
impl Symbol {
pub fn new(symbol: impl Into<String>) -> Self {
Self(symbol.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
pub fn into_inner(self) -> String {
self.0
}
}