serdevarexport

Actions Crate API

PHP function var_export() support for Serde.

Installation

With cargo add installed run:

sh $ cargo add -s serde_var_export

Example

```rust use serde_derive::Serialize;

[derive(Serialize)]

struct Foo { names: Vec, nums: Vec, }

fn main() { let foo = Foo { names: vec!["hello".toowned(), "world".toowned()], nums: vec![1, 2, 3], }; let s = serdevarexport::to_string(&foo).unwrap(); println!("{}", s); } ```

print result:

php array( 'names' => array( 0 => 'hello', 1 => 'world', ), 'nums' => array( 0 => 1, 1 => 2, 2 => 3, ), )

Limitation

Now only support serialization, deserialization will support in future.

License

The Unlicense.