[][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

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());