Skip to content

Commit 45d8dcb

Browse files
committed
properly sync readme and fix docs
1 parent bad6dc1 commit 45d8dcb

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

crates/amf0/README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,39 @@
1919
A pure-rust implementation of AMF0 encoder and decoder.
2020

2121
This crate provides serde support for serialization and deserialization of AMF0 data.
22-
## Specification
2322

24-
| Name | Version | Link | Comments |
25-
| --- | --- | --- | --- |
26-
| Action Message Format -- AMF 0 | - | <https://rtmp.veriskope.com/pdf/amf0-file-format-specification.pdf> | Refered to as 'AMF0 spec' in this documentation |
23+
See the [changelog](./CHANGELOG.md) for a full release history.
2724

28-
## Limitations
25+
### Feature flags
2926

30-
- Does not support AMF0 references.
31-
- Does not support the AVM+ Type Marker. (see AMF 0 spec, 3.1)
27+
* **`serde`** — Enables serde support
28+
* **`docs`** — Enables changelog and documentation of feature flags
29+
* **`preserve_order`** — Use an index map instead of a btree-map for Amf0Objects
3230

33-
## Example
31+
### Specification
3432

35-
```rust
36-
# fn test() -> Result<(), Box<dyn std::error::Error>> {
37-
# let bytes = &[0x02, 0, 1, b'a'];
38-
# let mut writer = Vec::new();
33+
|Name|Version|Link|Comments|
34+
|----|-------|----|--------|
35+
|Action Message Format – AMF 0|-|<https://rtmp.veriskope.com/pdf/amf0-file-format-specification.pdf>|Refered to as ‘AMF0 spec’ in this documentation|
36+
37+
### Limitations
38+
39+
* Does not support AMF0 references.
40+
* Does not support the AVM+ Type Marker. (see AMF 0 spec, 3.1)
41+
42+
### Example
43+
44+
````rust
3945
// Decode a string value from bytes
4046
let value: String = scuffle_amf0::from_slice(bytes)?;
4147

4248
// .. do something with the value
4349

4450
// Encode a value into a writer
4551
scuffle_amf0::to_writer(&mut writer, &value)?;
46-
# assert_eq!(writer, bytes);
47-
# Ok(())
48-
# }
49-
# test().expect("test failed");
50-
```
52+
````
5153

52-
## License
54+
### License
5355

5456
This project is licensed under the MIT or Apache-2.0 license.
5557
You can choose between one of them if you use this work.

crates/amf0/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
#![deny(unsafe_code)]
4747
#![deny(unreachable_pub)]
4848

49+
#[cfg(not(feature = "preserve_order"))]
50+
extern crate alloc;
51+
4952
#[cfg(feature = "serde")]
5053
pub mod de;
5154
pub mod decoder;

0 commit comments

Comments
 (0)