weave-weft · chunk
Source declarations, signatures and documentation for chunk.
Reviewed implementation boundary: Producer signatures must be computed over the exact manifest before validate/from_bytes or publication; an empty signature is rejected. Reader interfaces do not establish constant-memory storage, and chain reference metadata alone does not submit or prove anchoring. See /libraries/weft/publish.
Source: sigil/weave/models/weft/src/chunk.rs. SHA-256: 904783c8a95a70647b026d2858643ba92db3e4ec9e91d5e707b1dccd703170e5.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
chunk::DEFAULT_CHUNK_SIZE
Default Weft chunk size: 4 MiB.
pub const DEFAULT_CHUNK_SIZE: usize;Source line: 8.
chunk::MAX_CHUNK_SIZE
Largest single chunk accepted by the core model: 64 MiB.
pub const MAX_CHUNK_SIZE: usize;Source line: 11.
chunk::CHUNK_ID_DOMAIN
Domain tag for BLAKE3 chunk content IDs.
pub const CHUNK_ID_DOMAIN: &[u8];Source line: 14.
chunk::ChunkConfig
Chunker configuration.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct ChunkConfig {
}Source line: 18.
chunk::ChunkConfig::new
Create a config with an explicit chunk size.
pub fn new(chunk_size: usize) -> Result<Self>;Source line: 24.
chunk::ChunkConfig::chunk_size
Return the configured chunk size.
pub fn chunk_size(&self) -> usize;Source line: 35.
chunk::ChunkDescriptor
Descriptor for one chunk in a Weft payload.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct ChunkDescriptor {
/// Zero-based chunk index.
pub index: u64,
/// Byte offset in the original payload.
pub offset: u64,
/// Chunk length in bytes.
pub len: u32,
/// Domain-separated BLAKE3 content ID of this chunk.
pub id: WeftHash
}Source line: 50.
chunk::ChunkPayload
A chunk descriptor plus its bytes.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ChunkPayload {
/// Descriptor committed in the manifest.
pub descriptor: ChunkDescriptor,
/// Exact chunk bytes.
pub bytes: Vec<u8>
}Source line: 63.
chunk::chunk_id_for_bytes
Compute the deterministic Weft chunk ID for exact chunk bytes.
pub fn chunk_id_for_bytes(bytes: &[u8]) -> WeftHash;Source line: 71.
chunk::chunk_bytes
Split bytes into deterministic chunk descriptors.
pub fn chunk_bytes(data: &[u8], config: ChunkConfig) -> Result<Vec<ChunkDescriptor>>;Source line: 76.
chunk::chunk_payloads
Split bytes into deterministic chunk payloads.
pub fn chunk_payloads(data: &[u8], config: ChunkConfig) -> Result<Vec<ChunkPayload>>;Source line: 86.
chunk::Chunker
Streaming-friendly chunker over any Read source.
pub struct Chunker<R> {
}Source line: 111.
chunk::Chunker<R>::new
Create a new chunker.
pub fn new(reader: R, config: ChunkConfig) -> Self;Source line: 121.
chunk::Chunker<R>::next_chunk
Read and return the next chunk. Returns Ok(None) at EOF.
pub fn next_chunk(&mut self) -> Result<Option<ChunkPayload>>;Source line: 132.