Skip to content

Keys lib

SamwiseFilmore requested to merge keys-lib-cheap-header into master

The primary change here is moving pkgar-keys into this repository. However, I also refactored the existing pkgar crate to be two crates, pkgar-core is no-std and contains the basic type/trait definitions for various package actions, and pkgar requires std and provides all the filesystem access stuff. There are numerous refactorings in here:

  • Errors got some changes, and uses the thiserror crate to derive the error trait and some from impls. I also pulled in UserFacingError for displaying errors (especially errors with source attributes) to the user. This could probably use some improvement, but it was easy.
  • PackageSrc had been an enum, but I needed to split up the bytes implementation from the file implementation so that it could be used in pkgar-core. It's now a trait that provides most of the methods needed to read package info. It can definitely still handle optimization, but I think it's a reasonable design. Some more high-level APIs should probably be added to make it more possible to reduce network calls if a PackageSrc was implemented on a network location.
  • I also modified the tests a bit, but they pass.

Please let me know anything that you notice, I'm happy to implement improvements before merge.

keys-lib can be deleted, this branch is based on it.

Merge request reports