Skip to main content

Crate tapped

Crate tapped 

Source
Expand description

§tapped

A Rust wrapper for the tap ATProto sync utility.

Tap simplifies ATProto sync by handling the firehose connection, verification, backfill, and filtering. This crate provides an idiomatic async Rust interface to tap’s HTTP API and WebSocket event stream.

§Features

  • Connect to an existing tap instance or spawn one as a subprocess
  • Strongly-typed configuration with builder pattern
  • Async event streaming with automatic acknowledgment
  • Full HTTP API coverage for repo management and statistics

§Example

use tapped::{TapProcess, TapConfig, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let config = TapConfig::builder()
        .database_url("sqlite://tap.db")
        .build();

    // Spawn tap and get a client
    let process = TapProcess::spawn_default(config).await?;
    let client = process.client()?;

    // Check health
    client.health().await?;

    // Add repos to track
    client.add_repos(&["did:plc:example1234567890abc"]).await?;

    // Stream events
    let mut receiver = client.channel().await?;
    while let Ok(event) = receiver.recv().await {
        // Event is automatically acknowledged when dropped
    }

    Ok(())
}

Structs§

Cursors
Cursor positions.
DidDocument
A DID document.
EventReceiver
Receiver for events from a tap WebSocket channel.
IdentityEvent
An identity event from the tap stream.
ReceivedEvent
Wrapper around Event that includes the ack trigger.
RecordEvent
A record event from the tap stream.
RepoInfo
Information about a tracked repository.
Service
A service in a DID document.
TapClient
HTTP client for interacting with a tap instance.
TapConfig
Configuration for a tap instance.
TapConfigBuilder
Builder for TapConfig.
TapProcess
A running tap process.
VerificationMethod
A verification method in a DID document.

Enums§

AccountStatus
Account status.
Error
The error type for tapped operations.
Event
An event from the tap stream.
LogLevel
Log level for tap process.
RecordAction
Action performed on a record.
RepoState
Repository sync state.

Type Aliases§

Result
A specialised Result type for tapped operations.