//! Custom routing: turning a `(host, method, path)` request into the
//! script that should answer it.
//!
//! This module is the single source of truth for how PiCloud routes
//! work. The user contract:
//!
//!   * **Path kinds** — `exact`, `prefix`, `param`. Validation rules
//!     in `pattern`; the orchestrator parses the raw stored strings
//!     into typed `PathPattern` values for matching.
//!   * **Host kinds** — `any`, `strict`, `wildcard`. Same shape.
//!   * **Within-kind uniqueness** — two routes of the same kind that
//!     could match the same request are a configuration error.
//!     See `conflict`.
//!   * **Cross-kind precedence at request time** — `exact` wins
//!     absolute; among non-exact, more leading-literal segments
//!     wins; tie → `param > prefix`. See `matcher`.
//!   * **Host dispatch** — `strict > wildcard > any`; longest matching
//!     wildcard suffix breaks ties between wildcards.

pub mod app_domains;
pub mod conflict;
pub mod matcher;
pub mod pattern;
pub mod table;

pub use app_domains::{AppDomainTable, CompiledAppDomain};
pub use conflict::{conflicts, ConflictReason};
pub use matcher::{MatchResult, Matched};
pub use pattern::{
    parse_app_domain, HostPattern, ParseError, ParsedAppDomain, PathPattern, PathSegment,
};
pub use table::RouteTable;
