85 releases (23 breaking)

new 0.119.0 Oct 25, 2024
0.118.0 Sep 18, 2024
0.117.0 Jul 29, 2024
0.115.0-rc2 Mar 20, 2024
0.38.0 Nov 18, 2020

#40 in Magic Beans

Download history 1344/week @ 2024-07-05 956/week @ 2024-07-12 699/week @ 2024-07-19 1260/week @ 2024-07-26 451/week @ 2024-08-02 921/week @ 2024-08-09 655/week @ 2024-08-16 1003/week @ 2024-08-23 1113/week @ 2024-08-30 1169/week @ 2024-09-06 1651/week @ 2024-09-13 3077/week @ 2024-09-20 971/week @ 2024-09-27 1169/week @ 2024-10-04 3247/week @ 2024-10-11 4341/week @ 2024-10-18

10,210 downloads per month
Used in 60 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

~7–9MB
~156K SLoC