Skip to main content

Crate rocksky

Crate rocksky 

Source
Expand description

§Rocksky — async Rust SDK for the Rocksky XRPC API.

  • Async-first (tokio + reqwest)
  • Typed — every common entity is a strongly typed serde struct
  • Idiomatic — namespaced accessors: client.actor(), client.scrobble(), …
  • Escape hatchclient.call() (query) / client.procedure() for any method not yet wrapped
  • Pipe-friendly — every response type round-trips through serde_json, so you can stream results straight to stdout / shell pipelines.

§Quickstart

use rocksky::Client;

let client = Client::new();
let profile = client.actor().get_profile("alice.bsky.social").await?;
println!(
    "{} — {}",
    profile.display_name.as_deref().unwrap_or(""),
    profile.did.as_deref().unwrap_or(""),
);

let did = profile.did.clone().unwrap_or_default();
let scrobbles = client.scrobble().list().did(did).limit(10).send().await?;
for s in scrobbles {
    println!(
        "  {} — {}",
        s.artist.as_deref().unwrap_or("?"),
        s.title.as_deref().unwrap_or("?"),
    );
}

Authenticated calls take a bearer token:

let client = Client::builder().token("eyJhbGciOi…").build();

Re-exports§

pub use client::Client;
pub use client::ClientBuilder;
pub use error::Error;
pub use error::Result;
pub use resources::graph::FollowList;
pub use models::*;

Modules§

client
The top-level Client and its ClientBuilder.
error
SDK error types.
generated
http
Low-level XRPC HTTP transport used by every resource module.
models
Strongly typed response models.
resources
XRPC namespace modules — one per app.rocksky.* namespace.