Skip to main content

create

Function create 

Source
pub fn create(data: &[u8], opts: &CreateOptions) -> (Manifest, Vec<Vec<u8>>)
Expand description

Split data into fixed-size chunks and build its manifest. Returns the manifest and the chunk bytes in order (index 0 first) — a caller uploads each chunk (_content.put_block) then the manifest itself (_content.put_manifest), per §12.2.

opts.chunk_size must be non-zero (matches the reference: it never guards against zero either, and a zero chunk size is a caller bug, not a case worth silently tolerating).