Skip to main content

Crate enxame_metainfo

Crate enxame_metainfo 

Source
Expand description

Typed BitTorrent metainfo — a .torrent file (or a bare info dict from a magnet metadata exchange) parsed into a typed Metainfo, with the v1 info-hash (BEP-3) computed from the bencoded info dict.

Part of the pleme-io ENXAME suite (theory/ENXAME.md). The wire format is bencode; this crate is the typed border between those bytes and the engine: a parsed Metainfo is the proof a torrent is well-formed, and its InfoHash is the swarm’s identity.

Canonical-only (M1 scope). bencode::parse accepts only canonical bencode (sorted, unique dict keys), so the info dict re-encodes to the exact bytes a conforming client produced — and the SHA-1 of those bytes is the correct info-hash. Lenient parsing with raw-span hashing (for the rare non-canonical torrent in the wild) is a documented follow-up; it cannot change the value for any conforming torrent.

Structs§

FileEntry
One file in a multi-file torrent.
InfoDict
The info dict — the hashed, swarm-identifying core of a torrent.
InfoHash
A 20-byte BitTorrent v1 info-hash — the swarm’s identity.
Metainfo
A parsed .torrent.

Enums§

Error
A typed metainfo parse failure.
Layout
The layout of a torrent’s content — the two shapes BEP-3 admits.