Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

palimpsest-core

Shared types, BLAKE3 hashing, seeded PRNG, and error taxonomy. This crate performs no IO — it is pure types and computation.

CrawlSeed

#![allow(unused)]
fn main() {
pub struct CrawlSeed { pub value: u64 }

impl CrawlSeed {
    pub fn new(value: u64) -> Self;
    pub fn rng(&self) -> ChaCha8Rng;       // Deterministic PRNG
    pub fn derive(&self, index: u64) -> Self; // Child seed via BLAKE3 mixing
}
}

ContentHash

#![allow(unused)]
fn main() {
pub struct ContentHash([u8; 32]); // Copy, Eq, Ord, Hash

impl ContentHash {
    pub fn of(data: &[u8]) -> Self;           // BLAKE3 hash
    pub fn as_bytes(&self) -> &[u8; 32];
    pub fn as_hex(&self) -> String;
    pub fn from_bytes(bytes: [u8; 32]) -> Self;
}
}

CaptureInstant

#![allow(unused)]
fn main() {
pub struct CaptureInstant {
    pub wall: DateTime<Utc>,  // Wall clock
    pub logical: u64,         // Monotonic counter
}

impl CaptureInstant {
    pub fn new(wall: DateTime<Utc>, logical: u64) -> Self;
}
}

Implements Copy, Ord, Serialize, Deserialize.

CrawlContextId

#![allow(unused)]
fn main() {
pub struct CrawlContextId(pub u64);
}

Opaque identifier for a crawl session. Implements Copy.

CrawlTarget

#![allow(unused)]
fn main() {
pub struct CrawlTarget {
    pub url: Url,
    pub depth: u32,
    pub parent: Option<ContentHash>,
}
}

PalimpsestError

#![allow(unused)]
fn main() {
#[non_exhaustive]
pub enum PalimpsestError {
    Network(String),
    Protocol(String),
    Rendering(String),
    Policy(String),
    DeterminismViolation { context: String, expected: String, actual: String },
    Storage(String),
    Replay(String),
}
}

Every failure in the system is classified into exactly one of these seven variants. See Error Taxonomy for details.

Key Invariant

This crate contains no IO, no async, no network calls. It is the foundation that every other crate depends on.