// =============================================================================
// Copyright (c) 2025 - 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Lifecycle phase for transcode engines.
/// Internal lifecycle phase tracked by the lifecycle guard.
///
/// The variant ordering mirrors the documented call sequence:
///
/// 1. `Uninitialized` — newly constructed; only `reset` is legal.
/// 2. `Fresh` — just reset; first input may be supplied.
/// 3. `Streaming` — at least one `transcode` call has been observed.
/// 4. `Finished` — `finish` completed; the only legal next step is `reset`.
/// 5. `Poisoned` — reset or finish execution failed after state may have
/// changed; only a successful `reset` can return to `Fresh`.
pub