Skip to main content

Crate bynk_registry_core

Crate bynk_registry_core 

Source
Expand description

The Bynk registry’s admission rules, I/O-free (first-party registry track §3.4, decision E of #2321): unpack, pack and admit an archive in memory.

No std::fs, no ring, no network. The native registry (bynk registry add / serve) links this as a library; the same source builds to a standalone wasm32 module with a C ABI (abi) that the hosted registry’s admission adapter loads, so the client, the reference server and the service apply one implementation.

Modules§

abi
The module boundary (first-party registry track §3.4): a plain C ABI, no wasm-bindgen, so the build is one .wasm file and no glue.
protocol
The registry protocol’s data (packaging slice 4a, #2274, decision D; track design/tracks/packaging.md §6.1): a registry’s config.json, its index lines, and the canonical payloads their signatures cover.

Structs§

Admitted
An upload that passed admission.
ArchiveError
Why an archive was refused: always bynk.registry.bad_archive.
Refusal
Why a registry refused an upload: a stable code for the publish API’s JSON error, and a message.
Requirement
A dependency or npm requirement in an index line.
Tree
A package’s files in memory: /-separated relative path to bytes, ordered byte-wise by path — the order an archive and its checksum use.

Constants§

BAD_ARCHIVE
MAX_UNPACKED
The most an archive may unpack to.

Functions§

admit
Admit upload. When expected is Some((name, version)), the package must be exactly that.
is_excluded
What a package archive leaves out: build output, npm’s cache, and every hidden file or directory (.git, .env, editor state) — a published package carries its sources, never a secret beside them.
pack
Pack tree canonically: the archive bytes and the tree checksum a consumer will compute from them. Excluded files (is_excluded) are left out.
unpack
Unpack archive into a Tree, applying the hardening rules above.