use core::fmt;
use crate::utils::constants::RAY_PKG_PROTOCOL;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PackageUri {
pub protocol: String,
pub name: String,
}
impl PackageUri {
pub fn new(name: String) -> Self {
Self {
protocol: RAY_PKG_PROTOCOL.to_string(),
name,
}
}
}
impl fmt::Display for PackageUri {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}://{}", self.protocol, self.name)
}
}