1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! AT Protocol identifier types with validation.
//!
//! Provides validated newtypes for all AT Protocol identifiers:
//! DID, Handle, NSID, AT-URI, TID, `RecordKey`, Datetime, and `AtIdentifier`.
//!
//! # Examples
//!
//! ```
//! use proto_blue_syntax::{Did, Handle, Nsid, AtUri, Tid, RecordKey};
//!
//! // Parse and validate a DID
//! let did = Did::new("did:plc:z72i7hdynmk6r22z27h6tvur").unwrap();
//! assert_eq!(did.method(), "plc");
//!
//! // Parse a handle
//! let handle = Handle::new("alice.bsky.social").unwrap();
//! assert_eq!(handle.to_string(), "alice.bsky.social");
//!
//! // Parse an NSID
//! let nsid = Nsid::new("app.bsky.feed.post").unwrap();
//! assert_eq!(nsid.authority(), "app.bsky.feed");
//! assert_eq!(nsid.name(), "post");
//!
//! // Parse an AT-URI
//! let uri = AtUri::new("at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/abc123").unwrap();
//! assert_eq!(uri.collection(), Some("app.bsky.feed.post"));
//! assert_eq!(uri.rkey(), Some("abc123"));
//!
//! // Generate a TID from a timestamp
//! let tid = Tid::from_timestamp(1704067200_000_000, 0);
//! assert_eq!(tid.to_string().len(), 13);
//!
//! // Validate a record key
//! let rkey = RecordKey::new("self").unwrap();
//! assert!(RecordKey::new(".").is_err()); // "." is not allowed
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use is_valid_language;
pub use ;
pub use ;
pub use ;
pub use is_valid_uri;