A Rust Implementation of AMF (Action Media Format).
Add following lines to your Cargo.toml
:
toml
[dependencies]
amf = "0.1"
Following code decodes a AMF0 encoded value read from the standard input:
```rust // file: examples/decode_amf0.rs extern crate amf;
use std::io; use amf::{Value, Version};
fn main() { let mut input = io::stdin(); let amf0value = Value::readfrom(&mut input, Version::Amf0).unwrap(); println!("VALUE: {:?}", amf0_value); } ```
An execution result:
bash
$ cat src/testdata/amf0-number.bin | cargo run --example decode_amf0
VALUE: Amf0(Number(3.5))