Crate libpna

Source
Expand description

A library for reading and writing PNA archives

This library provides utilities necessary to manage PNA archives abstracted over a reader or writer. Great strides are taken to ensure that an archive is never required to be fully resident in memory, and all objects provide largely a streaming interface to read bytes from.

Modules§

prelude
PNA Prelude.

Structs§

Archive
An object providing access to a PNA file. An instance of an Archive can be read and/or written.
ChunkType
A 4-byte chunk type code.
CompressionLevel
Compression level of each algorithm.
EntryBuilder
A builder for creating a new NormalEntry.
EntryDataReader
Reader for Entry data.
EntryHeader
Represents the entry information header that expressed in the FHED chunk.
EntryName
A UTF-8 encoded entry name.
EntryNameError
Error of invalid EntryName.
EntryPart
A structure representing the split Entry for archive splitting.
EntryReference
A UTF-8 encoded entry reference.
EntryReferenceError
Error of invalid EntryReference.
ExtendedAttribute
Entry extended attribute.
HashAlgorithm
Password hash algorithm.
Metadata
Metadata information about an entry.
NormalEntry
A normal entry in a PNA archive.
Permission
Permission struct represents an owner, group, and permissions for an entry.
RawChunk
A raw chunk in a PNA archive.
ReadOptions
Options for reading an entry.
ReadOptionsBuilder
Builder for ReadOptions.
SolidArchive
An object that provides write access to solid mode PNA files.
SolidEntry
A solid mode entry in a PNA archive.
SolidEntryBuilder
A builder for creating a new solid Entry.
SolidHeader
Represents the entry information header that expressed in the SHED chunk.
WriteOptions
Options for writing an entry.
WriteOptionsBuilder
Builder for WriteOptions.

Enums§

ChunkTypeError
ChunkType validation error.
CipherAlgorithm
Cipher algorithm.
CipherMode
Cipher mode of encryption algorithm.
Compression
Compression method.
DataKind
Type of entry.
Encryption
Encryption algorithm.
ReadEntry
A NormalEntry or SolidEntry read from an archive.

Constants§

MIN_CHUNK_BYTES_SIZE
Minimum required size in bytes to represent Chunk. length: 4 bytes + chunk type: 4 bytes + data: 0 bytes + crc: 4 bytes
PNA_HEADER
The magic number of Portable-Network-Archive

Traits§

Chunk
A trait representing a chunk in a PNA archive.
Entry
A trait representing an entry in a PNA archive.

Functions§

read_as_chunks
Read archive as chunks from given reader.
read_chunks_from_slice
Read archive as chunks from given bytes.