appstream

Crates.ioappstream
lib.rsappstream
version0.2.2
sourcesrc
created_at2020-08-13 01:48:57.546731
updated_at2022-01-16 21:51:09.289017
descriptionAppstream files parser
homepage
repositoryhttps://github.com/bilelmoussaoui/appstream
max_upload_size
id276004
size185,769
Bilal Elmoussaoui (bilelmoussaoui)

documentation

README

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(())
}
Commit count: 132

cargo fmt