diff --git a/crates/jacquard-common/src/lib.rs b/crates/jacquard-common/src/lib.rs index 2a9d868c..148e85ba 100644 --- a/crates/jacquard-common/src/lib.rs +++ b/crates/jacquard-common/src/lib.rs @@ -6,7 +6,7 @@ pub use into_static::IntoStatic; pub use smol_str; pub use url; -/// A copy-on-write immutable string type that uses [`SmolStr`] for +/// A copy-on-write immutable string type that uses [`smol_str::SmolStr`] for /// the "owned" variant. #[macro_use] pub mod cowstr; diff --git a/crates/jacquard-common/src/types/crypto.rs b/crates/jacquard-common/src/types/crypto.rs index 047b12b4..62588744 100644 --- a/crates/jacquard-common/src/types/crypto.rs +++ b/crates/jacquard-common/src/types/crypto.rs @@ -22,8 +22,6 @@ use std::borrow::Cow; /// Known multicodec key codecs for Multikey public keys /// - -/// ``` #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum KeyCodec { /// Ed25519 diff --git a/crates/jacquard-common/src/types/did_doc.rs b/crates/jacquard-common/src/types/did_doc.rs index fb910d69..6c7b6437 100644 --- a/crates/jacquard-common/src/types/did_doc.rs +++ b/crates/jacquard-common/src/types/did_doc.rs @@ -35,7 +35,7 @@ pub struct DidDocument<'a> { #[serde(borrow)] pub id: Did<'a>, - /// Alternate identifiers for the subject, such as at:// + /// Alternate identifiers for the subject, such as at://\ #[serde(borrow)] pub also_known_as: Option>>, @@ -66,7 +66,7 @@ impl crate::IntoStatic for DidDocument<'_> { } impl<'a> DidDocument<'a> { - /// Extract validated handles from `alsoKnownAs` entries like `at://`. + /// Extract validated handles from `alsoKnownAs` entries like `at://\`. pub fn handles(&self) -> Vec> { self.also_known_as .as_ref() diff --git a/crates/jacquard/src/identity/resolver.rs b/crates/jacquard/src/identity/resolver.rs index 2c3b98c3..91e10e79 100644 --- a/crates/jacquard/src/identity/resolver.rs +++ b/crates/jacquard/src/identity/resolver.rs @@ -161,9 +161,9 @@ impl DidDocResponse { /// Handle → DID fallback step. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum HandleStep { - /// DNS TXT _atproto. + /// DNS TXT _atproto.\ DnsTxt, - /// HTTPS GET https:///.well-known/atproto-did + /// HTTPS GET https://\/.well-known/atproto-did HttpsWellKnown, /// XRPC com.atproto.identity.resolveHandle against a provided PDS base PdsResolveHandle, diff --git a/crates/jacquard/src/lib.rs b/crates/jacquard/src/lib.rs index e1747ee6..cd2cb5d1 100644 --- a/crates/jacquard/src/lib.rs +++ b/crates/jacquard/src/lib.rs @@ -46,11 +46,9 @@ //! #[tokio::main] //! async fn main() -> miette::Result<()> { //! let args = Args::parse(); -//! //! // Create HTTP client //! let url = url::Url::parse(&args.pds).unwrap(); //! let client = BasicClient::new(url); -//! //! // Create session //! let session = Session::from( //! client @@ -63,17 +61,13 @@ //! .await? //! .into_output()?, //! ); -//! -//! println!("logged in as {} ({})", session.handle, session.did); //! client.set_session(session).await.unwrap(); -//! //! // Fetch timeline //! println!("\nfetching timeline..."); //! let timeline = client //! .send(GetTimeline::new().limit(5).build()) //! .await? //! .into_output()?; -//! //! println!("\ntimeline ({} posts):", timeline.feed.len()); //! for (i, post) in timeline.feed.iter().enumerate() { //! println!("\n{}. by {}", i + 1, post.post.author.handle); @@ -82,23 +76,21 @@ //! serde_json::to_string_pretty(&post.post.record).into_diagnostic()? //! ); //! } -//! //! Ok(()) //! } //! ``` //! -//! ## Clients +//! ## Client options: //! //! - Stateless XRPC: any `HttpClient` (e.g., `reqwest::Client`) implements `XrpcExt`, //! which provides `xrpc(base: Url) -> XrpcCall` for per-request calls with //! optional `CallOptions` (auth, proxy, labelers, headers). Useful when you //! want to pass auth on each call or build advanced flows. -//! Example -//! ```ignore -//! use jacquard::client::XrpcExt; -//! use jacquard::api::app_bsky::feed::get_author_feed::GetAuthorFeed; -//! use jacquard::types::ident::AtIdentifier; -//! +//! ```no_run +//! # use jacquard::client::XrpcExt; +//! # use jacquard::api::app_bsky::feed::get_author_feed::GetAuthorFeed; +//! # use jacquard::types::ident::AtIdentifier; +//! # //! #[tokio::main] //! async fn main() -> anyhow::Result<()> { //! let http = reqwest::Client::new(); @@ -124,13 +116,13 @@ //! `AtClient` with a `new(Url)` constructor. //! //! Per-request overrides (stateless) -//! ```ignore -//! use jacquard::client::{XrpcExt, AuthorizationToken}; -//! use jacquard::api::app_bsky::feed::get_author_feed::GetAuthorFeed; -//! use jacquard::types::ident::AtIdentifier; -//! use jacquard::CowStr; -//! use miette::IntoDiagnostic; -//! +//! ```no_run +//! # use jacquard::client::{XrpcExt, AuthorizationToken}; +//! # use jacquard::api::app_bsky::feed::get_author_feed::GetAuthorFeed; +//! # use jacquard::types::ident::AtIdentifier; +//! # use jacquard::CowStr; +//! # use miette::IntoDiagnostic; +//! # //! #[tokio::main] //! async fn main() -> miette::Result<()> { //! let http = reqwest::Client::new(); @@ -157,8 +149,7 @@ //! - Use `MemoryTokenStore` for ephemeral sessions, tests, and CLIs. //! - For persistence, `FileTokenStore` stores session tokens as JSON on disk. //! See `client::token::FileTokenStore` docs for details. -//! Example -//! ```ignore +//! ```no_run //! use jacquard::client::{AtClient, FileTokenStore}; //! let base = url::Url::parse("https://bsky.social").unwrap(); //! let store = FileTokenStore::new("/tmp/jacquard-session.json");