pub struct WriteConfig {
pub out_path: Option<PathBuf>,
pub format: OutFormat,
pub overwrite: bool,
pub compression: Option<ParquetCompression>,
pub compression_level: Option<u32>,
}Expand description
Output configuration for writing Arrow data.
Captures the output file path, format, compression settings, and overwrite
behavior. Created separately from ReadStatPath,
which handles only input path validation.
Fields§
§out_path: Option<PathBuf>Optional output file path.
format: OutFormatOutput format (defaults to CSV).
overwrite: boolWhether to overwrite an existing output file.
compression: Option<ParquetCompression>Optional Parquet compression algorithm.
compression_level: Option<u32>Optional Parquet compression level.
Implementations§
Source§impl WriteConfig
impl WriteConfig
Sourcepub fn new(
out_path: Option<PathBuf>,
format: Option<OutFormat>,
overwrite: bool,
compression: Option<ParquetCompression>,
compression_level: Option<u32>,
) -> Result<Self, ReadStatError>
pub fn new( out_path: Option<PathBuf>, format: Option<OutFormat>, overwrite: bool, compression: Option<ParquetCompression>, compression_level: Option<u32>, ) -> Result<Self, ReadStatError>
Creates a new WriteConfig after validating the output path, format,
and compression settings.
§Errors
Returns ReadStatError if the output path, format, or compression settings
are invalid.
fn validate_format(format: Option<OutFormat>) -> OutFormat
Sourcefn validate_out_extension(
path: &Path,
format: OutFormat,
) -> Result<Option<PathBuf>, ReadStatError>
fn validate_out_extension( path: &Path, format: OutFormat, ) -> Result<Option<PathBuf>, ReadStatError>
Validates the output file extension matches the format.
Sourcefn validate_out_path(
path: Option<PathBuf>,
overwrite: bool,
) -> Result<Option<PathBuf>, ReadStatError>
fn validate_out_path( path: Option<PathBuf>, overwrite: bool, ) -> Result<Option<PathBuf>, ReadStatError>
Validates the output path exists and handles overwrite logic.
Sourcefn validate_compression_level(
compression: ParquetCompression,
compression_level: Option<u32>,
) -> Result<Option<u32>, ReadStatError>
fn validate_compression_level( compression: ParquetCompression, compression_level: Option<u32>, ) -> Result<Option<u32>, ReadStatError>
Validates compression level is valid for the given compression algorithm.
Trait Implementations§
Source§impl Clone for WriteConfig
impl Clone for WriteConfig
Source§fn clone(&self) -> WriteConfig
fn clone(&self) -> WriteConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WriteConfig
impl RefUnwindSafe for WriteConfig
impl Send for WriteConfig
impl Sync for WriteConfig
impl Unpin for WriteConfig
impl UnwindSafe for WriteConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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