Jacquard
A suite of Rust crates for the AT Protocol.
Goals and Features
- Validated, spec-compliant, easy to work with, and performant baseline types
- Batteries-included, but easily replaceable batteries.
- Easy to extend with custom lexicons
- Straightforward OAuth
- stateless options (or options where you handle the state) for rolling your own
- all the building blocks of the convenient abstractions are available
- lexicon Value type for working with unknown atproto data (dag-cbor or json)
- order of magnitude less boilerplate than some existing crates
- use as much or as little from the crates as you need
Example
Dead simple API client. Logs in with OAuth and prints the latest 5 posts from your timeline.
// Note: this requires the `loopback` feature enabled (it is currently by default)
use Parser;
use CowStr;
use GetTimeline;
use ;
use AtprotoClientMetadata;
use OAuthClient;
use LoopbackConfig;
use Scope;
use XrpcClient;
use IntoDiagnostic;
async
Component crates
Jacquard is broken up into several crates for modularity. The correct one to use is generally jacquard itself, as it re-exports the others.
jacquard: Main cratejacquard-common: Foundation cratejacquard-api: Autogenerated API bindingsjacquard-oauth: atproto OAuth implementationjacquard-identity: Identity resolutionjacquard-lexicon: Lexicon parsing and code generationjacquard-derive: Derive macros for lexicon types
Development
This repo uses Flakes from the get-go.
# Dev shell
# or run via cargo
# build
There's also a justfile 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.