pub struct FixedLengthFileMockerBuilder { /* private fields */ }Expand description
A helper struct for building an instance of a FixedLengthFileMocker struct.
Implementations§
Source§impl FixedLengthFileMockerBuilder
impl FixedLengthFileMockerBuilder
Sourcepub fn with_schema(self, schema_path: PathBuf) -> Self
pub fn with_schema(self, schema_path: PathBuf) -> Self
Set the relative or absolute path to the json schema file to use.
Sourcepub fn with_out_file(self, out_path: PathBuf) -> Self
pub fn with_out_file(self, out_path: PathBuf) -> Self
Set the relative or absolute path to the output file to produce.
Sourcepub fn with_num_rows(self, n_rows: usize) -> Self
pub fn with_num_rows(self, n_rows: usize) -> Self
Set the number of rows to generate.
Sourcepub fn with_num_threads(self, n_thread: usize) -> Self
pub fn with_num_threads(self, n_thread: usize) -> Self
Set the number of threads (logical cores) to use.
Sourcepub fn with_write_buffer_size(self, buffer_size: usize) -> Self
pub fn with_write_buffer_size(self, buffer_size: usize) -> Self
Set the buffer size for writing to file (in number of rows).
Sourcepub fn with_force_create_new(self, force_create_new: bool) -> Self
pub fn with_force_create_new(self, force_create_new: bool) -> Self
Set the writer option to return an error if the file already exists.
Sourcepub fn with_truncate_existing(self, truncate_existing: bool) -> Self
pub fn with_truncate_existing(self, truncate_existing: bool) -> Self
Set the writer option to truncate the output file if it already exists.
pub fn with_thread_channel_capacity(self, capacity: Option<usize>) -> Self
Sourcepub fn with_default_values(self) -> Self
pub fn with_default_values(self) -> Self
Set default values for the optional configuration fields.
§Note
Default mode is always single-threaded since I/O bottleneck leads to multithreading not being efficient.
Sourcepub fn try_build(self) -> Result<FixedLengthFileMocker>
pub fn try_build(self) -> Result<FixedLengthFileMocker>
Try creating a new FixedLengthFileMocker from the previously set values.
§Errors
If any of the required fields are None, or if the schema deserialization failed.
Sourcepub fn build(self) -> FixedLengthFileMocker
pub fn build(self) -> FixedLengthFileMocker
Creates a new FixedLengthFileMocker from the previously set values.
§Note
This method internally calls the try_build method and simply unwraps the returned
Result. If you don’t care about error propagation, use this method over try_build.
§Panics
If any of the required fields are None, or if the schema deserialization failed.
Trait Implementations§
Source§impl Default for FixedLengthFileMockerBuilder
impl Default for FixedLengthFileMockerBuilder
Source§fn default() -> FixedLengthFileMockerBuilder
fn default() -> FixedLengthFileMockerBuilder
Auto Trait Implementations§
impl Freeze for FixedLengthFileMockerBuilder
impl RefUnwindSafe for FixedLengthFileMockerBuilder
impl Send for FixedLengthFileMockerBuilder
impl Sync for FixedLengthFileMockerBuilder
impl Unpin for FixedLengthFileMockerBuilder
impl UnwindSafe for FixedLengthFileMockerBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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