use rkyv::{Archive, Serialize};
use std::{borrow::Borrow, ops::Deref};
#[derive(Archive, Serialize, PartialEq, Eq, Hash, Debug)]
#[rkyv(archived = PackPathArchived)]
#[rkyv(derive(PartialEq, Eq, Hash, Debug))]
pub struct PackPath {
inner: String,
}
impl PackPath {
pub fn from_string(inner: String) -> Self {
Self { inner }
}
}
impl Deref for PackPath {
type Target = str;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl Borrow<str> for PackPath {
fn borrow(&self) -> &str {
self.inner.as_str()
}
}
impl Deref for PackPathArchived {
type Target = str;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl Borrow<str> for PackPathArchived {
fn borrow(&self) -> &str {
self.inner.as_str()
}
}