web_static_pack_common/
pack_path.rs1use rkyv::{Archive, Serialize};
4use std::{borrow::Borrow, ops::Deref};
5
6#[derive(Archive, Serialize, PartialEq, Eq, Hash, Debug)]
12#[rkyv(archived = PackPathArchived)]
13#[rkyv(derive(PartialEq, Eq, Hash, Debug))]
14pub struct PackPath {
15 inner: String,
16}
17impl PackPath {
18 pub fn from_string(inner: String) -> Self {
22 Self { inner }
23 }
24}
25
26impl Deref for PackPath {
28 type Target = str;
29
30 fn deref(&self) -> &Self::Target {
31 &self.inner
32 }
33}
34impl Borrow<str> for PackPath {
35 fn borrow(&self) -> &str {
36 self.inner.as_str()
37 }
38}
39
40impl Deref for PackPathArchived {
41 type Target = str;
42
43 fn deref(&self) -> &Self::Target {
44 &self.inner
45 }
46}
47impl Borrow<str> for PackPathArchived {
48 fn borrow(&self) -> &str {
49 self.inner.as_str()
50 }
51}