speedyspec-php-serialize
PHP's serialize format in Rust: serialize, unserialize, maybe_serialize, and conversions to hook values.
Part of the SpeedySpec platform.
Role: platform. Seam: container.
What it gives you
serializeandunserialize: PHP's format, byte for byte, overPhpValueandPhpKey.maybe_serialize,maybe_unserializeandis_serialized: WordPress's helpers.to_hook_valueandfrom_hook_value: conversions to the Hook API'sValue.
Install
Requirements
Rust 1.99.
Example
Serialize an array, check it, and read it back.
use ;
let value = Array;
let bytes = serialize;
assert_eq!;
assert!;
assert_eq!;
Where it fits
Options, metadata and theme.json values are stored serialized, so the contracts for those seams
(speedyspec-wp-meta-contracts, speedyspec-wp-posts-contracts, speedyspec-wp-theme-json-contracts) use these
types. No PHP runtime is involved.
Versioning
SemVer, 0.x: a minor version may break the API. MSRV is Rust 1.99. SpeedySpec's own version (ADR-028) is the PHP runtime's major, not this crate's.
License
MIT