Skip to main content

Splitter

Trait Splitter 

Source
pub trait Splitter: Send + Sync {
    // Required methods
    fn find_split_points(&self, bytes: &[u8], max_chunks: usize) -> Vec<usize>;
    fn estimate_bytes_per_row(&self, sample: &[u8]) -> usize;
}
Expand description

Format-specific splitter: decides where it is safe to divide an input byte stream into independent chunks.

Required Methods§

Source

fn find_split_points(&self, bytes: &[u8], max_chunks: usize) -> Vec<usize>

Return sorted byte offsets where the input may be split. The first offset should normally be 0 and the last should be bytes.len(). Adjacent offsets produce one chunk range.

Source

fn estimate_bytes_per_row(&self, sample: &[u8]) -> usize

Estimate the average bytes per record from a sample of the input.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§