silpkg/lib.rs
1//! `silpkg` is a library for interacting with [SIL](https://achurch.org/SIL/) PKG files
2//!
3//! # Features
4//! This library separates parsing/modification logic from IO by using [coroutines](https://doc.rust-lang.org/beta/unstable-book/language-features/coroutines.html)
5//! and aims to support many ways of interfacing with the base logic module.
6//! Currently only a synchronous interface is implemented in [`sync`].
7//!
8//! - [X] Sync
9//! - [X] reading PKG files
10//! - [X] reading uncompressed entries
11//! - [X] adding uncompressed entries
12//! - [X] reading deflate compressed entries
13//! - [X] adding deflate compressed entries
14//! - [X] creating new PKG files
15//! - [ ] Slice
16//! - [ ] Async
17//!
18//! # Quick start
19//! To open an existing archive use [`Pkg::parse`](sync::Pkg::parse).
20//! To create a new archive use [`Pkg::create`](sync::Pkg::create).
21//! For information on how to interact with archives look around in [`Pkg`](sync::Pkg).
22
23#![warn(missing_docs)]
24#![feature(doc_cfg)]
25#![feature(seek_stream_len)]
26#![feature(iterator_try_collect)]
27#![feature(map_try_insert)]
28#![feature(coroutines, coroutine_trait)]
29#![feature(read_buf)]
30#![cfg_attr(not(feature = "std"), no_std)]
31
32extern crate alloc;
33
34/// Defines all the errors used by this library.
35pub mod errors;
36
37/// The low-level generator-based API that can be used when the high-level variants are not enough.
38#[cfg(feature = "unstable_base")]
39pub mod base;
40#[cfg(not(feature = "unstable_base"))]
41mod base;
42
43mod util;
44
45/// A synchronous interface for reading and writing PKG archives.
46#[cfg(feature = "std")]
47#[doc(cfg(feature = "std"))]
48pub mod sync;
49
50pub use base::{Compression, EntryCompression, EntryInfo, Flags};
51
52#[cfg(feature = "std")]
53#[doc(cfg(feature = "std"))]
54pub use sync::Truncate;