pub struct FileFactory {
pub rng: SmallRng,
pub uncompressed_size: UncompressedSize,
pub compressibility: Compressibility,
pub file_name_count: u64,
}
Expand description
A compact in-memory representation of data that can be stored in a file.
Fields§
§rng: SmallRng
§uncompressed_size: UncompressedSize
§compressibility: Compressibility
§file_name_count: u64
Implementations§
Source§impl FileFactory
impl FileFactory
pub fn new( rng: SmallRng, uncompressed_size: UncompressedSize, compressibility: Compressibility, ) -> Self
Sourcepub fn generate_filename(&mut self) -> String
pub fn generate_filename(&mut self) -> String
Generate a unique filename that can be used for a file created by this factory.
Sourcepub fn generate_bytes(&mut self) -> Vec<u8> ⓘ
pub fn generate_bytes(&mut self) -> Vec<u8> ⓘ
Generate all the bytes for this file in memory. For a given FileData, this function is deterministic.
Auto Trait Implementations§
impl Freeze for FileFactory
impl RefUnwindSafe for FileFactory
impl Send for FileFactory
impl Sync for FileFactory
impl Unpin for FileFactory
impl UnwindSafe for FileFactory
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