[][src]Function ckb_std::syscalls::load_cell_by_field

pub fn load_cell_by_field(
    buf: &mut [u8],
    offset: usize,
    index: usize,
    source: Source,
    field: CellField
) -> Result<usize, SysError>

Load cell by field

Return the loaded data length or a syscall error

Arguments

  • buf - a writable buf used to receive the data
  • offset - offset
  • index - index of cell
  • source - source of cell
  • field - field of cell

Example

let mut buf = [0u8; size_of::<u64>()];
let len = load_cell_by_field(&mut buf, 0, 0, Source::GroupInput, CellField::Capacity).unwrap();
assert_eq!(len, buf.len());