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