Crates.io | appstream |
lib.rs | appstream |
version | 0.2.2 |
source | src |
created_at | 2020-08-13 01:48:57.546731 |
updated_at | 2022-01-16 21:51:09.289017 |
description | Appstream files parser |
homepage | |
repository | https://github.com/bilelmoussaoui/appstream |
max_upload_size | |
id | 276004 |
size | 185,769 |
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(())
}