Crates.io | dpkg-query-json |
lib.rs | dpkg-query-json |
version | 0.1.12 |
source | src |
created_at | 2021-05-31 13:52:50.450122 |
updated_at | 2021-05-31 16:08:24.73465 |
description | A crate for parsing "dpkg-query" in json. Debian/Ubuntu. |
homepage | |
repository | https://github.com/py-whl-rust/dpkg-query-json |
max_upload_size | |
id | 404237 |
size | 9,160 |
A crate for parsing “dpkg-query” in json.
use dpkg_query_json::QueryFieldPackage;
let fields = vec![String::from("Package"),
String::from("Version"),
String::from("Architecture")];
let packages = vec![String::from("dpkg")];
QueryFieldPackage::new(fields, packages).json(); //Map<String, Value>
// {"dpkg": Object({"Architecture": String("amd64"), "Version": String("1.19.7ubuntu3")})}
use dpkg_query_json::QueryFieldPackage;
let fields = vec![String::from("Package"),
String::from("Version"),
String::from("Architecture")];
let packages = vec![String::from("dpkg")];
QueryFieldPackage::new(fields, packages).json_string(); //String
// "{\"dpkg\":{\"Architecture\":\"amd64\",\"Version\":\"1.19.7ubuntu3\"}}"
Architecture
Bugs
Conffiles
Config-Version
Conflicts
Breaks
Depends
Description
Enhances
Essential
Filename
Installed-Size
MD5sum
MSDOS-Filename
Maintainer
Origin
Package
Pre-Depends
Priority
Provides
Recommends
Replaces
Revision
Section
Size
Source
Status
Suggests
Version