Expand description
Package format handling for the soar package manager.
This crate provides functionality for detecting package formats and handling format-specific operations like desktop integration.
§Supported Formats
- AppImage: Self-contained Linux applications with embedded resources
- FlatImage: Similar to AppImage with different internal structure
- RunImage: Another AppImage-like format
- Wrappe: Windows PE wrapper format
- ELF: Standard Linux executables
§Example
use std::fs::File;
use std::io::BufReader;
use soar_package::{get_file_type, PackageFormat, PackageError};
fn detect_format(path: &str) -> Result<PackageFormat, PackageError> {
let file = File::open(path).map_err(|e| PackageError::IoError {
action: "opening file".to_string(),
source: e,
})?;
let mut reader = BufReader::new(file);
get_file_type(&mut reader)
}Re-exports§
pub use error::ErrorContext;pub use error::PackageError;pub use error::Result;pub use formats::common::integrate_package;pub use formats::get_file_type;pub use formats::PackageFormat;pub use formats::APPIMAGE_MAGIC_BYTES;pub use formats::ELF_MAGIC_BYTES;pub use formats::FLATIMAGE_MAGIC_BYTES;pub use formats::PNG_MAGIC_BYTES;pub use formats::RUNIMAGE_MAGIC_BYTES;pub use formats::SVG_MAGIC_BYTES;pub use formats::WRAPPE_MAGIC_BYTES;pub use traits::PackageExt;