unityrs-export 1.0.0

Unity asset exports beside the textures: sprites, the NGUI atlas cutter and its crops, and the UnityPy extractor tree.
Documentation
//! Exports beside the textures, for the batch engine (`docs/DESIGN.md`
//! section 4's `unityrs-export` row): the `sprites` kind (E17, gate row
//! X2), the NGUI atlas cutter (`docs/plans/extract.md` E21 to E26, gate row
//! X5) and the JSON writer it writes with.
//!
//! - [`ngui::cut`]: one input's view to its Sprites' PNGs, its atlases'
//!   crops (PNG), each atlas's JSON, the skips with their closed reasons and
//!   the sheet-to-atlas units, as `docs/BATCH_SPEC.md` sections 3, 4.3, 4.4
//!   and 5 say, the textures `outputs.textures` selects among them.
//! - [`ngui::winners`]: 4.5's steps 1 to 3 over the cuts of several inputs.
//! - [`keys`]: key templates, `safe()` and the key rules, which the
//!   engine's validation checks a spec's templates and keys with.
//! - [`simple`]: metered single-object `TextAsset`, Font, MonoBehaviour JSON
//!   (or raw fallback), and Tier X `VideoClip` resource payloads.
//! - [`shader::export`]: Tier A Shader text with metered platform-blob decoding.
//! - [`extractor`]: UnityPy's extraction order and names, typed reports,
//!   and corrected `GameObject` crawls, through a caller's metered sink.
//! - [`pyjson`]: `CPython` 3.11's `json.dumps(value, indent=2)` of a typetree
//!   value, byte for byte (E24).
//!
//! It is written from the specification, not ported from the Python
//! references (`tools/parity/ngui_cutter.py`, `tools/parity/sprites_kind.py`),
//! which record the fixtures it is tested against (`unityrs-testkit`'s
//! `tests/fixtures/ngui.json` and `tests/fixtures/sprites.json`). The
//! sprites kind's files port UnityPy 1.25.2's Sprite rules (MIT), as do
//! the reads' names a `Sprite` or a `Texture2D` cannot be given
//! (`ngui::read::SETTERLESS`), each saying so in its header, with the
//! notice in the crate's `LICENSE-UNITYPY`.
//! The cutter checks `max_attempt_evictions` itself, after each Environment
//! call (registration's included), and `max_export_work` through the
//! engine's [`ngui::Hooks::export_work`], as it does the stop, the decode
//! work and the memory budgets; their values, the spool and 4.6's prefix
//! conflicts are the engine's.
#![forbid(unsafe_code)]
// No panics on an input's contents (docs/plans/core.md section 3.15), as in
// the core and the decoders. Tests may opt out.
#![cfg_attr(
    not(test),
    deny(
        clippy::unwrap_used,
        clippy::expect_used,
        clippy::panic,
        clippy::todo,
        clippy::unimplemented,
        clippy::unreachable,
        clippy::indexing_slicing
    )
)]

pub mod audio;
pub use unityrs_audio::VorbisHeaders;
pub mod extractor;
#[cfg(feature = "gltf")]
pub mod gltf;
pub mod ngui;
pub mod pyjson;
mod pyjson_numbers;
pub mod shader;
pub mod simple;
#[cfg(feature = "test-counters")]
pub mod testing;

/// Key templates, `safe()` and the key rules (`docs/BATCH_SPEC.md` 2.1 to
/// 2.3), the engine's and the cutter's one copy: validation checks a spec's
/// templates and literal keys through it ([`keys::check_template`],
/// [`keys::check_prefixed`]), and an attempt expands and checks its keys.
pub use ngui::keys;