/appstream

Appstream files parser

Primary LanguageRustMIT LicenseMIT

appstream

Appstream files parser using Rust & xmltree

Specifications: https://www.freedesktop.org/software/appstream/docs/

How to use

use appstream::{Collection, Component, ParseError};

fn main() -> Result<(), ParseError> {
    let collection = Collection::from_path("/var/lib/flatpak/appstream/flathub/x86_64/active/appstream.xml".into())?;
    // Find a specific application by id
    println!("{:#?}", collection.find_by_id("org.gnome.design.Contrast".into()));

    // Find the list of gedit plugins
    collection.components.iter()
        .filter(|c| c.extends.contains(&"org.gnome.gedit".into()))
        .collect::<Vec<&Component>>();
        
    Ok(())
}