pub trait ImportSource {
// Required method
fn next(&mut self) -> Result<Option<ImportedMemory>>;
// Provided method
fn size_hint(&self) -> Option<usize> { ... }
}Expand description
Source of imported memories.
Implementations read memories from a specific format (JSON, YAML, CSV, etc.) and yield them one at a time for processing.
§Streaming
Sources should read data incrementally where possible to support large files without loading everything into memory.
§Example Implementation
ⓘ
impl ImportSource for JsonSource {
fn next(&mut self) -> Result<Option<ImportedMemory>> {
// Read next line, parse JSON, return memory
}
fn size_hint(&self) -> Option<usize> {
None // Unknown for streaming
}
}