Skip to main content

flash_lso/
lib.rs

1//! Library for reading and writing the Adobe Flash Local Shared Object (LSO) file format and the contained AMF0/AMF3 data
2
3#![deny(
4    anonymous_parameters,
5    nonstandard_style,
6    rust_2018_idioms,
7    trivial_casts,
8    trivial_numeric_casts,
9    unreachable_pub,
10    unused_extern_crates,
11    unused_qualifications,
12    variant_size_differences,
13    missing_docs,
14    missing_copy_implementations,
15    unsafe_code,
16    unused_crate_dependencies,
17    clippy::unwrap_used
18)]
19
20// Used only during benchmarks and tests
21#[cfg(test)]
22use criterion as _;
23#[cfg(test)]
24use serde_json as _;
25
26const HEADER_VERSION: [u8; 2] = [0x00, 0xbf];
27const HEADER_SIGNATURE: [u8; 10] = [0x54, 0x43, 0x53, 0x4f, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00];
28const PADDING: [u8; 1] = [0x00];
29
30const FORMAT_VERSION_AMF0: u8 = 0x0;
31
32#[cfg(feature = "amf3")]
33const FORMAT_VERSION_AMF3: u8 = 0x3;
34
35#[cfg(feature = "serde")]
36#[macro_use]
37extern crate serde;
38
39/// Reading and Writing of the AMF0 file format
40pub mod amf0;
41
42/// Reading and Writing of the AMF3 file format
43#[cfg(feature = "amf3")]
44pub mod amf3;
45
46/// Decoding error type
47pub mod errors;
48
49/// Private internal utils for reading
50mod nom_utils;
51pub use nom_utils::AMFResult;
52
53/// Reading of the Lso container format
54pub mod read;
55
56/// Types used for representing Lso contents
57pub mod types;
58
59/// Writing of the Lso container format
60pub mod write;
61
62/// Extra functionality such as decoders for popular external class formats
63pub mod extra;
64
65/// Reading and Writing of AMF Self Contained Packets
66pub mod packet;