alpm-types
Types for Arch Linux Package Management.
The provided types and the traits they implement can be used in package management related applications (e.g. package manager, repository manager, special purpose parsers and file specifications, etc.) which deal with libalpm based packages.
This library strives to provide all underlying types for writing ALPM based software as a leaf-crate, so that they can be shared across applications and none of them has to implement them itself.
Examples
Known CPU architectures are represented by the Architecture enum.
You can create members e.g. from str:
use FromStr;
use Architecture;
assert_eq!;
The date when a package has been built is represented using the BuildDate
struct, which tracks this in seconds since the epoch.
Apart from creating BuildDate from i64 or str, it can also be created from
DateTime<Utc>:
use ;
use BuildDate;
let datetime: BuildDate = from_utc.into;
assert_eq!;
The compressed size of a package is represented by CompressedSize which
tracks the size in bytes and can also be created from str:
use CompressedSize;
use FromStr;
assert_eq!;
The installed size of a package is represented by InstalledSize which
tracks the size in bytes and can also be created from str:
use InstalledSize;
use FromStr;
assert_eq!;
The name for a package is restricted to a specific set of characters.
You can create Name directly or from str, which yields a Result:
use FromStr;
use ;
assert_eq!;
assert_eq!;
Package types are distinguished using the PkgType enum. Its variants can be constructed from str:
use FromStr;
use PkgType;
assert_eq!;
Contributing
Please refer to the contribution guidelines to learn how to contribute to this project.
License
This project is licensed under the terms of the LGPL-3.0-or-later.