pub struct RandomChunkGenerator { /* private fields */ }Implementations§
Source§impl RandomChunkGenerator
impl RandomChunkGenerator
pub fn new( chunking_threshold: u64, min_chunk_size: u64, max_chunk_size: u64, ) -> Self
pub fn with_seed( chunking_threshold: u64, min_chunk_size: u64, max_chunk_size: u64, seed: u128, ) -> Self
Sourcepub fn adjust_last_chunks(&mut self)
pub fn adjust_last_chunks(&mut self)
Performs the necessary adjustements when the final size is known (i.e. upon finalization).
Trait Implementations§
Source§impl ChunkGenerator for RandomChunkGenerator
impl ChunkGenerator for RandomChunkGenerator
fn process_data(&mut self, data: &[u8]) -> Vec<Chunk>
fn signal_eos(&mut self) -> Vec<Chunk>
Source§fn chunks_count(&self) -> u64
fn chunks_count(&self) -> u64
Total number of chunks generated
Source§fn chunked_bytes_count(&self) -> u64
fn chunked_bytes_count(&self) -> u64
Total number of bytes received by the generator
Auto Trait Implementations§
impl Freeze for RandomChunkGenerator
impl RefUnwindSafe for RandomChunkGenerator
impl Send for RandomChunkGenerator
impl Sync for RandomChunkGenerator
impl Unpin for RandomChunkGenerator
impl UnsafeUnpin for RandomChunkGenerator
impl UnwindSafe for RandomChunkGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more