Skip to main content

microsandbox_image/
lib.rs

1//! OCI image pulling, EROFS materialization, and caching for microsandbox.
2//!
3//! This crate implements the OCI image lifecycle:
4//! - Registry communication (pull, auth, platform resolution)
5//! - Layer caching with content-addressable dedup
6//! - Tar ingestion into in-memory file trees
7//! - EROFS filesystem image generation (per-layer and flat modes)
8//! - ext4 upper disk formatting for writable overlay upper layer
9//! - Minimal EROFS reader for Append patches
10
11// New lints introduced in rustc 1.95 fire on existing code; cleanup
12// tracked separately.
13#![allow(
14    clippy::identity_op,
15    clippy::useless_conversion,
16    clippy::needless_update
17)]
18
19mod archive;
20mod cache;
21pub mod checkpoint;
22mod config;
23pub(crate) mod crc32c;
24mod digest;
25pub mod erofs;
26mod error;
27pub mod ext4;
28mod flat;
29pub(crate) mod layer;
30pub(crate) mod path_bytes;
31mod platform;
32mod progress;
33mod pull;
34mod registry;
35pub mod snapshot;
36pub(crate) mod stitch;
37pub mod storage_lease;
38pub mod tar;
39pub mod tree;
40
41//--------------------------------------------------------------------------------------------------
42// Re-Exports
43//--------------------------------------------------------------------------------------------------
44
45pub use archive::{
46    ImageArchiveFormat, ImageLoadOptions, ImageSaveConfig, ImageSaveLayer, ImageSaveRequest,
47    LoadedImage, load_archive, load_archive_into, load_archive_with, save_archive,
48    save_docker_archive,
49};
50pub use cache::{CachedImageMetadata, CachedLayerMetadata, FlatRootfsRef, GlobalCache};
51pub use config::ImageConfig;
52pub use digest::Digest;
53pub use error::{ImageError, ImageResult};
54pub use flat::merge_erofs_layers;
55pub use microsandbox_types::RegistryAuth;
56pub use oci_client::Reference;
57pub use platform::{Arch, Os, Platform};
58pub use progress::{PullProgress, PullProgressHandle, PullProgressSender, progress_channel};
59pub use pull::{PullOptions, PullPolicy, PullResult, RootfsMaterialization};
60pub use registry::{Registry, RegistryBuilder};