Skip to main content

sui_store/
lib.rs

1//! Nix store abstraction with SeaORM metadata.
2//!
3//! Provides the [`Store`] trait that all store backends implement (local filesystem,
4//! binary cache over HTTP). Includes SeaORM entity models that map 1:1 to the Nix
5//! SQLite schema.
6//!
7//! # Architecture
8//!
9//! - [`Store`] — async trait defining the store contract (query, add, GC)
10//! - [`LocalStore`] — reads `/nix/store` + SQLite via SeaORM
11//! - [`BinaryCacheStore`] — read-only HTTP client for cache.nixos.org / Cachix / Attic
12//! - [`HttpClient`] — pluggable HTTP backend for testability
13//!
14//! # Error handling
15//!
16//! All store operations return [`StoreResult<T>`], which wraps [`StoreError`].
17//! Binary cache operations produce [`BinaryCacheError`] internally, which converts
18//! into [`StoreError`] via `From` impls.
19
20pub mod binary_cache;
21pub mod convergence;
22pub mod entity;
23pub mod http;
24pub mod local;
25pub mod nar;
26pub mod profile;
27pub mod substitute;
28pub mod traits;
29
30pub use binary_cache::{BinaryCacheError, BinaryCacheStore, BinaryCacheStoreBuilder};
31pub use http::{HttpClient, HttpError, HttpResponse, ReqwestHttpClient};
32pub use local::{LocalStore, LocalStoreMode};
33pub use nar::decompress_nar;
34pub use profile::{Generation, ProfileError, ProfileManager};
35pub use substitute::{SubstituteResult, Substitutor};
36pub use local::find_gc_roots;
37pub use convergence::{ConvergenceStore, DefaultConvergenceStore, GenerationalPath, ImpactReport};
38pub use traits::{CorruptPath, GcOptions, GcResult, OptimiseResult, PathInfo, Store, StoreError, StoreResult, VerifyResult};