Function ckb_std::syscalls::load_input_by_field
source · pub fn load_input_by_field(
buf: &mut [u8],
offset: usize,
index: usize,
source: Source,
field: InputField
) -> Result<usize, SysError>Expand description
Load input 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_input_by_field(&mut buf, 0, index, source, InputField::Since)?;
debug_assert_eq!(len, buf.len());