78 releases (21 breaking)

new 0.117.0-rc5 Jul 22, 2024
0.117.0-rc3 Jun 21, 2024
0.115.0-rc2 Mar 20, 2024
0.113.0-rc2 Dec 19, 2023
0.38.0 Nov 18, 2020

#159 in Magic Beans

Download history 1088/week @ 2024-03-30 573/week @ 2024-04-06 521/week @ 2024-04-13 980/week @ 2024-04-20 426/week @ 2024-04-27 903/week @ 2024-05-04 1000/week @ 2024-05-11 399/week @ 2024-05-18 294/week @ 2024-05-25 671/week @ 2024-06-01 1071/week @ 2024-06-08 1550/week @ 2024-06-15 1859/week @ 2024-06-22 1183/week @ 2024-06-29 1089/week @ 2024-07-06 931/week @ 2024-07-13

5,287 downloads per month
Used in 58 crates (8 directly)

MIT license

255KB
5.5K SLoC

ckb-resource

This crate is a component of ckb.

Bundled resources for the CKB binary.

Minimum Supported Rust Version policy (MSRV)

This crate's minimum supported rustc version is 1.75.0


lib.rs:

Bundles resources in the ckb binary.

This crate bundles the files ckb.toml, ckb-miner.toml, default.db-options, and all files in the directory specs in the binary.

The bundled files can be read via Resource::Bundled, for example:

// Read bundled ckb.toml
use ckb_resource::{Resource, CKB_CONFIG_FILE_NAME};

let ckb_toml_bytes = Resource::bundled(CKB_CONFIG_FILE_NAME.to_string()).get().unwrap();
println!("ckb.toml\n{}", String::from_utf8(ckb_toml_bytes.to_vec()).unwrap());

These bundled files can be customized for different chains using spec branches. See Template.

Dependencies

~6–8MB
~143K SLoC