[−][src]Function ckb_std::syscalls::load_header_by_field
pub fn load_header_by_field(
buf: &mut [u8],
offset: usize,
index: usize,
source: Source,
field: HeaderField
) -> Result<usize, SysError>
Load header by field
Return the loaded data length or a syscall error
Arguments
buf
- a writable buf used to receive the dataoffset
- offsetindex
- indexsource
- sourcefield
- field
Example
let mut buf = [0u8; 8]; let len = load_header_by_field(&mut buf, 0, index, source, HeaderField::EpochNumber)?; debug_assert_eq!(len, buf.len());