Crates.io | panamax-search-lib |
lib.rs | panamax-search-lib |
version | 0.2.0 |
source | src |
created_at | 2024-09-24 19:24:45.786988 |
updated_at | 2024-10-26 01:18:04.80391 |
description | Search crates in a panamax mirror like `cargo search` |
homepage | |
repository | https://github.com/qtfkwk/panamax-search |
max_upload_size | |
id | 1385597 |
size | 23,944 |
Search crates in a panamax mirror like cargo search
cargo search
outputSee also:
A relatively small percentage of crates have issues getting the description from the Cargo.toml
file embedded in the .crate
file for various reasons; some of these can be reasonably
mitigated, others force panamax-search
to omit the description.
Affected | Issue | Status |
---|---|---|
275 crates | No description |
Omit |
27 crates | Has cargo.toml instead of Cargo.toml |
Fixed |
13 crates | Has [project] instead of [package] |
Fixed |
pnetlink |
Two [dependencies] sections |
N/A |
screen-13 |
Corrupt .crate file |
N/A |
servo |
Zero entries in .crate file |
Omit |
svd_macros |
Malformed Cargo.toml |
Omit |
N/A (not applicable) means that the issue was observed in older versions of these crates, but has since been fixed by its author.
JSON was chosen as the cache file format for a few reasons.
TOML was a leading contender for consistency, but unfortunately it isn't extremely conducive to
BTreeMap data; in particular, it puts each crate in a [crates.name]
section with version
and
description
fields, which makes it less than the ideal (1 crate per line) and impossible to
usefully deserialize the name
field (?).
JSON doesn't have these problems and can also be easily queried by both native web as well as CLI
tools like jq
.
By default, the versions displayed are the latest non-yanked version of each crate, however the library also captures and uses the actual latest version ignoring yanked status.
The cache file stores either just the latest version (v
) if there are no yanked versions, just
the latest yanked version (y
) if there are no non-yanked versions, or both if present.
Capturing separate descriptions for each latest and latest non-yanked version was contemplated,
but there were zero observed instances where the descriptions were different.
Storing duplicate descriptions nearly doubled the cache file size for no actual gain, and even
storing as a None
(just in case the need ever arose) still added about 25%.
So the idea was tabled.