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 auth;
21mod cache;
22mod config;
23pub(crate) mod crc32c;
24mod digest;
25pub mod erofs;
26mod error;
27pub mod ext4;
28pub(crate) mod layer;
29mod platform;
30mod progress;
31mod pull;
32mod registry;
33pub mod snapshot;
34pub(crate) mod stitch;
35pub mod tar;
36pub mod tree;
37
38//--------------------------------------------------------------------------------------------------
39// Re-Exports
40//--------------------------------------------------------------------------------------------------
41
42pub use archive::{
43    ImageArchiveFormat, ImageLoadOptions, ImageSaveConfig, ImageSaveLayer, ImageSaveRequest,
44    LoadedImage, load_archive, save_archive, save_docker_archive,
45};
46pub use auth::RegistryAuth;
47pub use cache::{CachedImageMetadata, CachedLayerMetadata, GlobalCache};
48pub use config::ImageConfig;
49pub use digest::Digest;
50pub use error::{ImageError, ImageResult};
51pub use oci_client::Reference;
52pub use platform::{Arch, Os, Platform};
53pub use progress::{PullProgress, PullProgressHandle, PullProgressSender, progress_channel};
54pub use pull::{PullOptions, PullPolicy, PullResult};
55pub use registry::{Registry, RegistryBuilder};