use std::fmt::Display;
#[derive(Clone, Default, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
pub struct StreamId(String);
impl From<String> for StreamId {
fn from(value: String) -> Self {
Self(value)
}
}
impl From<&str> for StreamId {
fn from(value: &str) -> Self {
Self(value.to_string())
}
}
impl From<StreamId> for String {
fn from(value: StreamId) -> Self {
value.0
}
}
impl Display for StreamId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl StreamId {
pub fn as_str(&self) -> &str {
&self.0
}
}