use ::std::fmt;
use ::std::hash::Hash;
use crate::common::error::MsgResult;
use ::std::borrow::Cow;
pub trait StrType: Sized + fmt::Display + Hash + PartialEq<Self> + Eq {
fn validate(value: &str) -> MsgResult<()>;
fn new<'a>(txt: impl Into<Cow<'a, str>>) -> MsgResult<Self>;
fn from_valid(txt: &str) -> Self {
Self::new(Cow::from(txt)).unwrap()
}
}