renamed UriPath to RepoPath for clarity

Orual 42f14e72 87879fab

Changed files
+22 -22
crates
jacquard-common
+19 -19
crates/jacquard-common/src/types/aturi.rs
··· 31 pub authority: AtIdentifier<'this>, 32 #[borrows(uri)] 33 #[covariant] 34 - pub path: Option<UriPath<'this>>, 35 #[borrows(uri)] 36 #[covariant] 37 pub fragment: Option<CowStr<'this>>, ··· 58 } else { 59 None 60 }; 61 - Some(UriPath { collection, rkey }) 62 } else { 63 None 64 } ··· 83 84 /// at:// URI path component (current subset) 85 #[derive(Clone, PartialEq, Eq, Hash, Debug)] 86 - pub struct UriPath<'u> { 87 pub collection: Nsid<'u>, 88 pub rkey: Option<RecordKey<Rkey<'u>>>, 89 } 90 91 - impl IntoStatic for UriPath<'_> { 92 - type Output = UriPath<'static>; 93 94 fn into_static(self) -> Self::Output { 95 - UriPath { 96 collection: self.collection.into_static(), 97 rkey: self.rkey.map(|rkey| rkey.into_static()), 98 } 99 } 100 } 101 102 - pub type UriPathBuf = UriPath<'static>; 103 104 pub static ATURI_REGEX: LazyLock<Regex> = LazyLock::new(|| { 105 // Fragment allows: / and \ and other special chars. In raw string, backslashes are literal. ··· 125 } else { 126 None 127 }; 128 - Some(UriPath { collection, rkey }) 129 } else { 130 None 131 }; ··· 166 } else { 167 None 168 }; 169 - Some(UriPath { collection, rkey }) 170 } else { 171 None 172 }; ··· 207 } else { 208 None 209 }; 210 - Some(UriPath { collection, rkey }) 211 } else { 212 None 213 }; ··· 286 self.inner.borrow_authority() 287 } 288 289 - pub fn path(&self) -> &Option<UriPath<'_>> { 290 self.inner.borrow_path() 291 } 292 ··· 339 } else { 340 None 341 }; 342 - Some(UriPath { collection, rkey }) 343 } else { 344 None 345 }; ··· 367 } else { 368 None 369 }; 370 - Some(UriPath { collection, rkey }) 371 } else { 372 None 373 } ··· 418 } else { 419 None 420 }; 421 - Some(UriPath { collection, rkey }) 422 } else { 423 None 424 }; ··· 470 } else { 471 None 472 }; 473 - Some(UriPath { collection, rkey }) 474 } else { 475 None 476 }; ··· 498 } else { 499 None 500 }; 501 - Some(UriPath { collection, rkey }) 502 } else { 503 None 504 } ··· 555 } else { 556 None 557 }; 558 - Some(UriPath { collection, rkey }) 559 } else { 560 None 561 } ··· 646 } else { 647 None 648 }; 649 - Some(UriPath { collection, rkey }) 650 } else { 651 None 652 }; ··· 672 } else { 673 None 674 }; 675 - Some(UriPath { collection, rkey }) 676 } else { 677 None 678 }
··· 31 pub authority: AtIdentifier<'this>, 32 #[borrows(uri)] 33 #[covariant] 34 + pub path: Option<RepoPath<'this>>, 35 #[borrows(uri)] 36 #[covariant] 37 pub fragment: Option<CowStr<'this>>, ··· 58 } else { 59 None 60 }; 61 + Some(RepoPath { collection, rkey }) 62 } else { 63 None 64 } ··· 83 84 /// at:// URI path component (current subset) 85 #[derive(Clone, PartialEq, Eq, Hash, Debug)] 86 + pub struct RepoPath<'u> { 87 pub collection: Nsid<'u>, 88 pub rkey: Option<RecordKey<Rkey<'u>>>, 89 } 90 91 + impl IntoStatic for RepoPath<'_> { 92 + type Output = RepoPath<'static>; 93 94 fn into_static(self) -> Self::Output { 95 + RepoPath { 96 collection: self.collection.into_static(), 97 rkey: self.rkey.map(|rkey| rkey.into_static()), 98 } 99 } 100 } 101 102 + pub type UriPathBuf = RepoPath<'static>; 103 104 pub static ATURI_REGEX: LazyLock<Regex> = LazyLock::new(|| { 105 // Fragment allows: / and \ and other special chars. In raw string, backslashes are literal. ··· 125 } else { 126 None 127 }; 128 + Some(RepoPath { collection, rkey }) 129 } else { 130 None 131 }; ··· 166 } else { 167 None 168 }; 169 + Some(RepoPath { collection, rkey }) 170 } else { 171 None 172 }; ··· 207 } else { 208 None 209 }; 210 + Some(RepoPath { collection, rkey }) 211 } else { 212 None 213 }; ··· 286 self.inner.borrow_authority() 287 } 288 289 + pub fn path(&self) -> &Option<RepoPath<'_>> { 290 self.inner.borrow_path() 291 } 292 ··· 339 } else { 340 None 341 }; 342 + Some(RepoPath { collection, rkey }) 343 } else { 344 None 345 }; ··· 367 } else { 368 None 369 }; 370 + Some(RepoPath { collection, rkey }) 371 } else { 372 None 373 } ··· 418 } else { 419 None 420 }; 421 + Some(RepoPath { collection, rkey }) 422 } else { 423 None 424 }; ··· 470 } else { 471 None 472 }; 473 + Some(RepoPath { collection, rkey }) 474 } else { 475 None 476 }; ··· 498 } else { 499 None 500 }; 501 + Some(RepoPath { collection, rkey }) 502 } else { 503 None 504 } ··· 555 } else { 556 None 557 }; 558 + Some(RepoPath { collection, rkey }) 559 } else { 560 None 561 } ··· 646 } else { 647 None 648 }; 649 + Some(RepoPath { collection, rkey }) 650 } else { 651 None 652 }; ··· 672 } else { 673 None 674 }; 675 + Some(RepoPath { collection, rkey }) 676 } else { 677 None 678 }
+3 -3
crates/jacquard-common/src/types/collection.rs
··· 3 use serde::Serialize; 4 5 use crate::types::{ 6 - aturi::UriPath, 7 nsid::Nsid, 8 recordkey::{RecordKey, RecordKeyType, Rkey}, 9 }; ··· 42 /// [`Nsid`]: crate::types::string::Nsid 43 fn repo_path<'u, T: RecordKeyType>( 44 rkey: &'u crate::types::recordkey::RecordKey<T>, 45 - ) -> UriPath<'u> { 46 - UriPath { 47 collection: Self::nsid(), 48 rkey: Some(RecordKey::from(Rkey::raw(rkey.as_ref()))), 49 }
··· 3 use serde::Serialize; 4 5 use crate::types::{ 6 + aturi::RepoPath, 7 nsid::Nsid, 8 recordkey::{RecordKey, RecordKeyType, Rkey}, 9 }; ··· 42 /// [`Nsid`]: crate::types::string::Nsid 43 fn repo_path<'u, T: RecordKeyType>( 44 rkey: &'u crate::types::recordkey::RecordKey<T>, 45 + ) -> RepoPath<'u> { 46 + RepoPath { 47 collection: Self::nsid(), 48 rkey: Some(RecordKey::from(Rkey::raw(rkey.as_ref()))), 49 }