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: u64Implementations§
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more