Expand description
Storage port — persist and retrieve pipeline results Storage port — persist and retrieve pipeline results.
Defines the generic StoragePort trait plus the OutputFormatter helper
that serialises pipeline outputs to CSV, JSONL, or JSON.
§Architecture
stygian-graph
├─ StoragePort (this file) ← always compiled
└─ Adapters (adapters/)
├─ FileStorage (always) → writes .jsonl to disk
├─ NullStorage (always) → no-op for tests
└─ PostgresStorage (feature="postgres") → sqlx PgPool§Example — writing results
use stygian_graph::ports::storage::{StoragePort, StorageRecord};
use serde_json::json;
async fn persist<S: StoragePort>(storage: &S) {
let record = StorageRecord::new("pipe-1", "fetch", json!({"url": "https://example.com"}));
storage.store(record).await.unwrap();
}Structs§
- Storage
Record - A single result record produced by a pipeline node.
Enums§
- Output
Format - Supported serialisation formats for pipeline result export.
Traits§
- Output
Formatter - Port: serialise a slice of
StorageRecords to bytes in a given format. - Storage
Port - Port: persist and retrieve
StorageRecords produced by pipelines.