Skip to main content

Crate soar_package

Crate soar_package 

Source
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;

Modules§

error
Error types for the package crate.
formats
Package format detection and handling.
traits
Traits for package operations.