pub struct TarUtils;Expand description
Tar processing utilities for layer extraction and offset calculation
Implementations§
Source§impl TarUtils
impl TarUtils
Sourcepub fn extract_layer_data(tar_path: &Path, layer_path: &str) -> Result<Vec<u8>>
pub fn extract_layer_data(tar_path: &Path, layer_path: &str) -> Result<Vec<u8>>
Extract layer data from tar archive
重要:直接返回tar中的原始layer数据,保持Docker兼容性 Docker镜像中的层已经是正确的gzip格式
Sourcepub fn find_layer_offset(tar_path: &Path, layer_path: &str) -> Result<u64>
pub fn find_layer_offset(tar_path: &Path, layer_path: &str) -> Result<u64>
Find the offset of a layer within the tar archive
Sourcepub fn list_tar_entries(tar_path: &Path) -> Result<Vec<(String, u64)>>
pub fn list_tar_entries(tar_path: &Path) -> Result<Vec<(String, u64)>>
Get a list of all entries in the tar archive with their sizes
Sourcepub fn validate_tar_archive(tar_path: &Path) -> Result<()>
pub fn validate_tar_archive(tar_path: &Path) -> Result<()>
Validate that a tar archive is readable and properly formatted
Sourcepub fn extract_manifest(tar_path: &Path) -> Result<String>
pub fn extract_manifest(tar_path: &Path) -> Result<String>
从 tar 文件中提取镜像清单
解析 Docker 镜像 tar 文件,提取 manifest.json 内容
Sourcepub fn extract_config(tar_path: &Path, config_path: &str) -> Result<String>
pub fn extract_config(tar_path: &Path, config_path: &str) -> Result<String>
从 tar 文件中提取镜像配置
解析 Docker 镜像 tar 文件,提取指定的配置文件内容
Sourcepub fn extract_config_data(
tar_path: &Path,
config_digest: &str,
) -> Result<Vec<u8>>
pub fn extract_config_data( tar_path: &Path, config_digest: &str, ) -> Result<Vec<u8>>
从 tar 文件中提取镜像配置数据为字节数组
Sourcepub fn parse_image_info(tar_path: &Path) -> Result<ImageInfo>
pub fn parse_image_info(tar_path: &Path) -> Result<ImageInfo>
解析 tar 文件获取完整的镜像信息
Auto Trait Implementations§
impl Freeze for TarUtils
impl RefUnwindSafe for TarUtils
impl Send for TarUtils
impl Sync for TarUtils
impl Unpin for TarUtils
impl UnwindSafe for TarUtils
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more