don't
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

tests: fix doc-tests

Signed-off-by: tjh <x@tjh.dev>

tjh 3062d1e5 3cb3e88f

+23 -25
+10 -10
crates/gordian-types/src/did.rs
··· 8 8 /// This is an _unsized_ type similiar to [`str`], so must always be used behind a pointer like 9 9 /// `&` or [`Box`]. 10 10 /// 11 - /// For an owned variant use [`OwnedDid`]. 11 + /// For an owned variant use [`DidBuf`]. 12 12 /// 13 13 /// See: <https://atproto.com/specs/did> 14 14 #[derive(Hash, PartialEq, Eq, PartialOrd, Ord)] ··· 35 35 /// # Example 36 36 /// 37 37 /// ```rust 38 - /// use atproto::did::Did; 38 + /// use gordian_types::Did; 39 39 /// 40 40 /// let did = Did::parse("did:plc:65gha4t3avpfpzmvpbwovss7").unwrap(); 41 41 /// assert_eq!(did.typ(), "did"); ··· 57 57 /// # Example 58 58 /// 59 59 /// ```rust 60 - /// use atproto::did::Did; 60 + /// use gordian_types::Did; 61 61 /// 62 62 /// let did = Did::parse("did:plc:65gha4t3avpfpzmvpbwovss7").unwrap(); 63 63 /// assert_eq!(did.typ(), "did"); ··· 79 79 /// # Example 80 80 /// 81 81 /// ```rust 82 - /// use atproto::did::Did; 82 + /// use gordian_types::Did; 83 83 /// 84 84 /// let did = Did::parse("did:plc:65gha4t3avpfpzmvpbwovss7").unwrap(); 85 85 /// assert_eq!(did.method(), "plc"); ··· 98 98 /// # Example 99 99 /// 100 100 /// ```rust 101 - /// use atproto::did::Did; 101 + /// use gordian_types::Did; 102 102 /// 103 103 /// let did = Did::parse("did:plc:65gha4t3avpfpzmvpbwovss7").unwrap(); 104 104 /// assert_eq!(did.ident(), "65gha4t3avpfpzmvpbwovss7"); ··· 176 176 // @TODO Validate percent encoding in ident. 177 177 } 178 178 179 - /// Length in bytes an [`OwnedDid`] can be before being allocated on the heap. 179 + /// Length in bytes an [`DidBuf`] can be before being allocated on the heap. 180 180 /// 181 181 // Assume most DIDs are PLC method, and this DID is a typical length. 182 182 const DID_PLC_LEN: usize = "did:plc:65gha4t3avpfpzmvpbwovss7".len(); ··· 195 195 Self { inner } 196 196 } 197 197 198 - /// Construct an `OwnedDid` from a `&'static str`. 198 + /// Construct an `DidBuf` from a `&'static str`. 199 199 /// 200 200 /// # Panics 201 201 /// ··· 208 208 Self { inner } 209 209 } 210 210 211 - /// Parse an `OwnedDid` from a `str`. 211 + /// Parse a `DidBuf` from a `str`. 212 212 /// 213 213 /// # Example 214 214 /// 215 215 /// ```rust 216 - /// use atproto::did::OwnedDid; 216 + /// use gordian_types::DidBuf; 217 217 /// 218 - /// let did = OwnedDid::parse("did:plc:65gha4t3avpfpzmvpbwovss7").unwrap(); 218 + /// let did = DidBuf::parse("did:plc:65gha4t3avpfpzmvpbwovss7").unwrap(); 219 219 /// assert_eq!(did.typ(), "did"); 220 220 /// assert_eq!(did.method(), "plc"); 221 221 /// assert_eq!(did.ident(), "65gha4t3avpfpzmvpbwovss7");
+1 -1
crates/gordian-types/src/handle.rs
··· 29 29 /// # Example 30 30 /// 31 31 /// ```rust 32 - /// use atproto::Handle; 32 + /// use gordian_types::Handle; 33 33 /// 34 34 /// let handle = Handle::parse("tjh.dev").expect("'tjh.dev' is a valid handle"); 35 35 /// assert_eq!(handle, "tjh.dev");
+2 -2
crates/gordian-types/src/nsid.rs
··· 33 33 /// # Example 34 34 /// 35 35 /// ```rust 36 - /// use atproto::Nsid; 36 + /// use gordian_types::Nsid; 37 37 /// 38 38 /// const NSID: &Nsid = unsafe { Nsid::from_static_unchecked("com.atproto.sync.getRecord") }; 39 39 /// ``` ··· 52 52 /// # Example 53 53 /// 54 54 /// ```rust 55 - /// use atproto::Nsid; 55 + /// use gordian_types::Nsid; 56 56 /// 57 57 /// let nsid = Nsid::parse("app.bsky.actor.profile").unwrap(); 58 58 /// ```
+2 -2
crates/gordian-types/src/serde.rs
··· 10 10 //! 11 11 //! #[derive(Debug, serde::Deserialize, serde::Serialize)] 12 12 //! struct SomeStruct<'a> { 13 - //! #[serde(borrow, with = "atproto::serde::cow_did")] 14 - //! did: Cow<'a, atproto::Did>, 13 + //! #[serde(borrow, with = "gordian_types::serde::cow_did")] 14 + //! did: Cow<'a, gordian_types::Did>, 15 15 //! } 16 16 //! ``` 17 17 //!
+8 -10
crates/gordian-types/src/tid.rs
··· 26 26 /// Maximum TID value. 27 27 /// 28 28 /// ```rust 29 - /// # use atproto::tid::Tid; 29 + /// # use gordian_types::tid::Tid; 30 30 /// let tid = Tid::MAX; 31 31 /// 32 32 /// assert_eq!(tid.micros(), 0b11111111111111111111111111111111111111111111111111111); ··· 39 39 /// Minimum TID value. 40 40 /// 41 41 /// ```rust 42 - /// # use atproto::tid::Tid; 42 + /// # use gordian_types::tid::Tid; 43 43 /// let tid = Tid::MIN; 44 44 /// 45 45 /// assert_eq!(tid.micros(), 0); ··· 99 99 /// # Example 100 100 /// 101 101 /// ```rust 102 - /// # use atproto::tid::Tid; 102 + /// # use gordian_types::tid::Tid; 103 103 /// let tid = Tid::from_secs(1_000_000, 0); 104 104 /// assert_eq!(tid.micros(), 1_000_000_000_000); 105 105 /// assert_eq!(tid.clock_id(), 0); ··· 122 122 /// # Examples 123 123 /// 124 124 /// ```rust 125 - /// # use atproto::tid::Tid; 125 + /// # use gordian_types::tid::Tid; 126 126 /// let t = Tid::parse("3m6g5swroas22").unwrap(); 127 127 /// assert_eq!(t.micros(), 1764033024479448); 128 128 /// assert_eq!(t.clock_id(), 0); ··· 147 147 /// Get the microsecond offset from UNIX epoch. 148 148 /// 149 149 /// ```rust 150 - /// # use atproto::tid::Tid; 150 + /// # use gordian_types::tid::Tid; 151 151 /// assert_eq!(Tid::MIN.micros(), 0); 152 152 /// assert_eq!(Tid::MAX.micros(), 9007199254740991); 153 153 /// ``` ··· 160 160 /// Get the clock ID for the TID. 161 161 /// 162 162 /// ```rust 163 - /// # use atproto::tid::Tid; 163 + /// # use gordian_types::tid::Tid; 164 164 /// assert_eq!(Tid::MIN.clock_id(), 0); 165 165 /// assert_eq!(Tid::MAX.clock_id(), 1023); 166 166 /// ``` ··· 179 179 /// # Example 180 180 /// 181 181 /// ```rust 182 - /// # use atproto::tid::Tid; 182 + /// # use gordian_types::tid::Tid; 183 183 /// # use time::OffsetDateTime; 184 184 /// const DT: OffsetDateTime = time::macros::datetime!(2025-11-25 10:28:43.234 UTC); 185 185 /// ··· 301 301 /// # Example 302 302 /// 303 303 /// ```rust 304 - /// use atproto::Tid; 305 - /// 306 - /// let tid = atproto::tid::parse("3m24udbjajf22").unwrap(); 304 + /// let tid = gordian_types::tid::parse("3m24udbjajf22").unwrap(); 307 305 /// assert_eq!(tid.micros(), 1759315551033835); 308 306 /// assert_eq!(tid.clock_id(), 0); 309 307 /// ```