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