Skip to content

Commit

Permalink
doc: add features description
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsoledad committed May 23, 2024
1 parent 107d411 commit 6ac96c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ Another serialization system: minimalist and canonicalization.
- [Schema Language](docs/schema_language.md)
- [Real-World Examples](docs/real_world_examples.md)

## Features
* `default` — Default features: `std`, utilizes `faster-hex` for hexadecimal operations and enables [bytes] standard features.
* `std` (enabled by default) — Default features: `std`, utilizes `faster-hex` for hexadecimal operations and enables [bytes] standard features.
* `bytes_vec` - Introduced in version 0.8, the 0.8 molecule defaults to [bytes], which has implications for use in the CKB runtime. The `bytes_vec` feature provides users with a compatibility option to maintain consistency with previous versions.

## Use in CKB scripts
When used in CKB scripts, no-std needs to be specified.

```toml
molecule = { version = "0.7", default-features = false }
```

Particularly, for versions later than 0.8, you need to additionally specify the bytes_vec feature.

```toml
molecule = { version = "0.8.0", default-features = false, features = ["bytes_vec"] }
```


## Tools

### Schema Compiler and Code Generator
Expand Down Expand Up @@ -77,3 +96,4 @@ Licensed under [MIT License].
[Rust]: https://www.rust-lang.org/
[Cargo]: https://doc.rust-lang.org/cargo/
[C]: https://en.wikipedia.org/wiki/C_%28programming_language%29
[bytes]: https://github.com/tokio-rs/bytes

0 comments on commit 6ac96c6

Please sign in to comment.