+23
-27
Cargo.lock
+23
-27
Cargo.lock
··················
+7
Cargo.toml
+7
Cargo.toml
···
+26
README.md
+26
README.md
···There's also a [`justfile`](https://just.systems/) for Makefile-esque commands to be run inside of the devShell, and you can generally `cargo ...` or `just ...` whatever just fine if you don't want to use Nix and have the prerequisites installed.+Something of a note to self. Developing a pattern with the string types (may macro-ify at some point). Each needs:+- new_static(): construction from a &'static str, using SmolStr's/CowStr's new_static() constructor to not allocate+- From<String>, From<CowStr>, From<SmolStr>, or TryFrom if likely enough to fail in practice to make panics common+Use SmolStr directly as the inner type if most or all of the instances will be under 24 bytes, save lifetime headaches.
+1
-1
crates/jacquard-common/Cargo.toml
+1
-1
crates/jacquard-common/Cargo.toml
······
+13
-9
crates/jacquard-common/src/cowstr.rs
+13
-9
crates/jacquard-common/src/cowstr.rs
··················
+8
crates/jacquard-common/src/types.rs
+8
crates/jacquard-common/src/types.rs
······
+200
-73
crates/jacquard-common/src/types/aturi.rs
+200
-73
crates/jacquard-common/src/types/aturi.rs
···+/// based on the regex here: https://github.com/bluesky-social/atproto/blob/main/packages/syntax/src/aturi_validation.ts+/// TODO: support IntoStatic on string types. For composites like this where all borrow from (present) input,+Regex::new(r##"^at://(?<authority>[a-zA-Z0-9._:%-]+)(/(?<collection>[a-zA-Z0-9-.]+)(/(?<rkey>[a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(#(?<fragment>/[a-zA-Z0-9._~:@!$&%')(*+,;=-[]/\]*))?$"##).unwrap()······
+23
-5
crates/jacquard-common/src/types/blob.rs
+23
-5
crates/jacquard-common/src/types/blob.rs
············
+21
-10
crates/jacquard-common/src/types/cid.rs
+21
-10
crates/jacquard-common/src/types/cid.rs
············
+52
crates/jacquard-common/src/types/collection.rs
+52
crates/jacquard-common/src/types/collection.rs
···
+5
-6
crates/jacquard-common/src/types/datetime.rs
+5
-6
crates/jacquard-common/src/types/datetime.rs
·········
+53
-14
crates/jacquard-common/src/types/did.rs
+53
-14
crates/jacquard-common/src/types/did.rs
·····················
+88
-30
crates/jacquard-common/src/types/handle.rs
+88
-30
crates/jacquard-common/src/types/handle.rs
···Regex::new(r"^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$").unwrap()··················
+26
-5
crates/jacquard-common/src/types/ident.rs
+26
-5
crates/jacquard-common/src/types/ident.rs
·········
+209
crates/jacquard-common/src/types/nsid.rs
+209
crates/jacquard-common/src/types/nsid.rs
···+/// Stored as SmolStr to ease lifetime issues and because, despite the fact that NSIDs *can* be 317 characters, most are quite short+Regex::new(r"^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\.[a-zA-Z][a-zA-Z0-9]{0,62})$").unwrap()
+402
crates/jacquard-common/src/types/recordkey.rs
+402
crates/jacquard-common/src/types/recordkey.rs
···+/// required by this trait, namely compliance with the [spec](https://atproto.com/specs/record-key)+/// Catch-all for any string meeting the overall Record Key requirements detailed https://atproto.com/specs/record-key
+38
-43
crates/jacquard-common/src/types/tid.rs
+38
-43
crates/jacquard-common/src/types/tid.rs
···············