utopia-php-std 0.1.0

PHP engine semantics (the value model, juggling and comparison, string, number, JSON, serialize, igbinary, sorting, filter and URL functions) for crates that must behave exactly like PHP.
Documentation
//! PHP engine semantics in Rust.
//!
//! Utopia crates must behave exactly like their PHP libraries, and much of
//! that behaviour comes from the PHP engine rather than the library: type
//! juggling, `is_numeric`, `(string)` casts, loose comparison, `strtolower`,
//! `mb_*`, `number_format`, `json_encode`/`json_decode`, `filter_var`,
//! `parse_url`. Each is reimplemented here once, and Utopia crates use these
//! functions instead of their own approximations.
//!
//! PHP values are [`Value`] ([`types`]): byte strings, ordered arrays with
//! integer and string keys, `stdClass`, and crate-defined objects. The
//! codecs ([`json`], [`serialize`], [`igbinary`]), comparisons and
//! [`sort`] work on it. Older string-level helpers ([`value`], [`string`],
//! [`format`], [`filter`]) take request-model `serde_json::Value`s, decoded
//! the way `Utopia\Http\Request` decodes bodies (objects are associative
//! arrays, except empty objects, which stay `stdClass`; [`Value::from_json`]
//! is the same mapping).

#![warn(missing_docs)]

/// The getting started guide (`guide.md`), compiled and run with the doctests.
#[cfg(doctest)]
#[doc = include_str!("../guide.md")]
pub struct GettingStarted;

mod argon2;
pub mod csv;
pub mod datetime;
pub mod encoding;
pub mod filter;
pub mod format;
pub mod glob;
pub mod igbinary;
pub mod json;
pub mod mb;
pub mod net;
pub mod number;
pub mod path;
pub mod pcre;
pub mod random;
pub mod serialize;
pub mod sort;
pub mod string;
pub mod system;
pub mod types;
pub mod url;
pub mod value;
pub mod yaml;

pub use types::{Array, ArrayKey, EngineError, Extension, Never, Str, Value};