heroforge-core 0.2.2

Pure Rust core library for reading and writing Fossil SCM repositories
Documentation
//! Heroforge repository synchronization.
//!
//! This module implements the Heroforge sync protocol for pushing and pulling
//! artifacts between repositories over QUIC.
//!
//! # Protocol Overview
//!
//! Heroforge sync uses a simple line-oriented protocol:
//!
//! 1. Client sends login credentials and push/pull cards
//! 2. Client sends igot cards for artifacts it has
//! 3. Client sends gimme cards for artifacts it wants
//! 4. Server responds with file cards containing requested artifacts
//! 5. Server sends igot cards for artifacts client doesn't have
//!
//! # Example (Builder API)
//!
//! ```no_run
//! use heroforge_core::Repository;
//!
//! let repo = Repository::open("local.forge")?;
//!
//! // Sync over QUIC
//! repo.sync()
//!     .to("quic://example.com:4443/repo")
//!     .push()?;
//! # Ok::<(), heroforge_core::FossilError>(())
//! ```

mod builder;
mod client;
mod protocol;

#[cfg(feature = "sync-quic")]
pub mod quic;

pub use builder::{SyncBuilder, SyncProtocol, SyncResult};
pub use client::SyncClient;
pub use protocol::{Card, Message};

#[cfg(feature = "sync-quic")]
pub use quic::{QuicClient, QuicServer, SyncStats as QuicSyncStats};