Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add features description #95

Merged
merged 1 commit into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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