1use snix_castore::B3Digest;
2use snix_castore::directoryservice::order_validator;
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("failure talking to a backing blob service")]
21 BlobService(#[source] std::io::Error),
22
23 #[error("unable to find directory {0}, referred from {1:?}")]
24 DirectoryNotFound(B3Digest, bytes::Bytes),
25
26 #[error("Invalid Ordering")]
27 OrderingError(#[source] order_validator::OrderingError),
28
29 #[error("unable to find blob {0}, referred from {1:?}")]
30 BlobNotFound(B3Digest, bytes::Bytes),
31
32 #[error(
33 "unexpected size in metadata for blob {0}, referred from {1:?} returned, expected {2}, got {3}"
34 )]
35 UnexpectedBlobMeta(B3Digest, bytes::Bytes, u32, u32),
36
37 #[error("failure using the NAR writer: {0}")]
38 NARWriterError(std::io::Error),
39}