hemtt_pbo/
lib.rs

1#![deny(clippy::all, clippy::nursery, missing_docs)]
2#![warn(clippy::pedantic)]
3#![allow(clippy::cast_possible_truncation, clippy::cast_lossless)]
4
5//! HEMTT - Arma 3 PBO Writer/Reader
6
7// Parts of the following code is derivative work of the code from the armake2 project by KoffeinFlummi,
8// which is licensed GPLv2. This code therefore is also licensed under the terms
9// of the GNU Public License, verison 2.
10
11// The original code can be found here:
12// https://github.com/KoffeinFlummi/armake2/blob/4b736afc8c615cf49a0d1adce8f6b9a8ae31d90f/src/pbo.rs
13
14use std::io::{Read, Write};
15
16mod error;
17mod file;
18mod model;
19pub mod prefix;
20mod read;
21mod sign_version;
22mod write;
23
24pub use error::Error;
25pub use model::{Checksum, Header, Mime};
26pub use prefix::Prefix;
27pub use read::ReadablePbo;
28pub use sign_version::BISignVersion;
29pub use write::WritablePbo;
30
31trait WritePbo {
32    fn write_pbo<O: Write>(&self, output: &mut O) -> Result<(), Error>;
33}
34
35trait ReadPbo: Sized {
36    fn read_pbo<I: Read>(input: &mut I) -> Result<(Self, usize), crate::error::Error>;
37}