rift-mock-core 0.25.0

Rift core engine: imposter lifecycle, matching, behaviors, scripting and flow-state — usable in-process without the CLI or admin server.
Documentation
//! Rift core engine — CLI-free imposter lifecycle, matching, behaviors, scripting and
//! flow-state. Usable in-process without the admin HTTP server or the `clap` CLI (issue #203);
//! the `rift-http-proxy` server and the `rift-ffi` C-ABI are thin consumers.

/// Whether the quamina-backed body-field candidate dimension is compiled into this build.
///
/// Reported at startup by the server binary so a benchmark — or an operator — can read the answer
/// off the artefact instead of inferring it from build flags, the same way `Global allocator:`
/// (#717) and `Runtime topology:` (RFC-712) already are. It is deliberately defined *here*, in the
/// crate whose `#[cfg]` gates the dimension, rather than in a consumer: issue #777 shipped this
/// dimension enabled in `rift-mock-core` and compiled out of both the binary and the C-ABI,
/// because each consumer takes this crate with `default-features = false` and nothing forwarded
/// the feature. A marker sourced from a consumer would have reported that consumer's own opinion;
/// this one reports what actually got compiled.
pub const QUAMINA_BODY_FIELD_DIMENSION: bool = cfg!(feature = "quamina-matching");

// ===== Core Mountebank-compatible modules =====
pub mod behaviors;
pub mod imposter;
pub mod proxy;
pub mod recording;
/// The imposter grammar as a JSON Schema (issue #1342).
#[cfg(feature = "schema")]
pub mod schema;

// ===== Rift Extensions (features beyond Mountebank) =====
pub mod extensions;
pub mod response;

// Re-export extension modules at top level for backward compatibility
pub use extensions::flow_state;
pub use extensions::stub_analysis;
pub use extensions::template;

// The TCP-fault carrier seam: an in-process embedder receives the carrier response the serve loop
// would have replaced with a socket abort, and names these as `rift_mock_core::tcp_fault_carrier`
// (issue #965), the same way it names `FastMap` below. `FaultCell`/`FaultIo`/`InjectedFault`/
// `is_injected_fault` let a listener other than the serve loop apply that abort itself (#1234);
// `LingerOnClose`/`arm_linger_if_requested` let it close a refused connection cleanly (#1460).
pub use imposter::fault_io::{
    FaultCell, FaultIo, InjectedFault, LingerOnClose, TcpFaultKind, apply_tcp_fault,
    arm_linger_if_requested, is_injected_fault, tcp_fault_carrier,
};

// Shared utilities
pub mod util;

#[cfg(test)]
mod test_support;
// Embedded-Rust consumers name the aliases as `rift_mock_core::FastMap` (issue #704).
pub use util::{FastMap, FastSet};

// Backends (pub for integration tests)
pub mod backends;

// Scripting validation/execution (pub so the admin server can validate stubs)
pub mod scripting;