use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Family(std::borrow::Cow<'static, str>);
impl Family {
pub const NODE: Family = Family(std::borrow::Cow::Borrowed("node"));
pub const RUST: Family = Family(std::borrow::Cow::Borrowed("rust"));
pub const PYTHON: Family = Family(std::borrow::Cow::Borrowed("python"));
pub const GO: Family = Family(std::borrow::Cow::Borrowed("go"));
pub const JVM: Family = Family(std::borrow::Cow::Borrowed("jvm"));
pub const DOTNET: Family = Family(std::borrow::Cow::Borrowed("dotnet"));
pub const PHP: Family = Family(std::borrow::Cow::Borrowed("php"));
pub const RUBY: Family = Family(std::borrow::Cow::Borrowed("ruby"));
pub fn new(name: impl Into<std::borrow::Cow<'static, str>>) -> Self {
Family(name.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl fmt::Display for Family {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl From<&'static str> for Family {
fn from(s: &'static str) -> Self {
Family::new(s)
}
}
impl AsRef<str> for Family {
fn as_ref(&self) -> &str {
self.as_str()
}
}