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