1use snix_castore::directoryservice::order_validator;
2use snix_castore::{B3Digest, blob_engine};
3
4mod import;
5mod listing;
6mod narcalculationservice;
7mod renderer;
8
9pub use import::{NarIngestionError, ingest_nar, ingest_nar_and_hash};
10pub use listing::{Error as ListingError, produce_listing};
11pub use narcalculationservice::{NarCalculationService, Renderer};
12pub use renderer::{Reader, write_nar, write_nar_simple};
13
14#[derive(Debug, thiserror::Error)]
16pub enum RenderError {
17 #[error("failure talking to a backing directory service")]
18 DirectoryService(#[source] snix_castore::directoryservice::Error),
19
20 #[error("IO error: {0}")]
21 IO(#[source] std::io::Error),
22
23 #[error("failure to open blob for reading")]
24 BlobEngine(#[from] blob_engine::Error),
25
26 #[error("unable to find directory {0}, referred from {1:?}")]
27 DirectoryNotFound(B3Digest, bytes::Bytes),
28
29 #[error("Invalid Ordering")]
30 OrderingError(#[source] order_validator::OrderingError),
31
32 #[error("unable to find blob {0}, referred from {1:?}")]
33 BlobNotFound(B3Digest, bytes::Bytes),
34
35 #[error(
36 "unexpected size in metadata for blob {0}, referred from {1:?} returned, expected {2}, got {3}"
37 )]
38 UnexpectedBlobMeta(B3Digest, bytes::Bytes, u32, u32),
39
40 #[error("failure using the NAR writer: {0}")]
41 NARWriterError(std::io::Error),
42}