Skip to content

bilelmoussaoui/appstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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(())
}

Releases

No releases published

Packages

No packages published

Languages