Function load_cell_by_field

Source
pub fn load_cell_by_field(
    buf: &mut [u8],
    offset: usize,
    index: usize,
    source: Source,
    field: CellField,
) -> Result<usize, SysError>
Available on neither crate feature native-simulator nor crate feature stub-syscalls.
Expand description

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