docs.rs failed to build ckb-std-0.2.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
ckb-std-0.15.3
ckb-std
This library contains serveral modules that help you write CKB contract with Rust.
Usage
Modules
syscalls
module: defines CKB syscallshigh_level
module: defines high level APIsdebug!
macro: aprintln!
like macro helps debuggingentry!
macro: defines contract entry pointdefault_alloc!
andlibc_alloc!
macro: defines global allocator for no-std rust
Memory allocator
ckb-std
supports two memory allocators: default allocator(pure rust) and libc allocator(libc dependent).
Default allocator
Default allocator allocate 64K
bytes memory, a panic will occured if out of memory.
Use the macro to change the default value:
// indicate the heap size(default heap size is 64KB, with 16B minimal memory block)
default_alloc!
Beware, the allocate parameters affect cycles of the contract; you should always test the contract after customizing parameters.
LibC allocator
To use libc
global allocator, you must static link libc into the binary, and enable libc
feature in this crate.
Examples
Check examples
and tests to learn how to use.
See also ckb-tool which helps you write tests.