Trait AddressedChunkArrayTrait

Source
pub trait AddressedChunkArrayTrait {
    // Required methods
    fn get_addressed_chunk_array_size(&self) -> u128;
    fn get_data_chunk(&self, data_zone: u128, data_chunk: u128) -> CandyShared;
    fn flatten(self) -> Vec<u8> ;
}
Expand description

A trait for operations on AddressedChunkArray, which is a vector of AddressedChunk instances representing a contiguous sequence of chunks of data.

Required Methods§

Source

fn get_addressed_chunk_array_size(&self) -> u128

Get the total size of the AddressedChunkArray.

Source

fn get_data_chunk(&self, data_zone: u128, data_chunk: u128) -> CandyShared

Get the data chunk from the specified DataZone and DataChunk.

§Arguments
  • data_zone - The index of the DataZone containing the desired data chunk.
  • data_chunk - The index of the desired data chunk within the specified DataZone.
§Returns

The CandyShared instance representing the desired data chunk, or a CandyShared::Option(None) instance if the data chunk is not found.

Source

fn flatten(self) -> Vec<u8>

Flatten the AddressedChunkArray into a byte vector.

Implementors§