pub struct WriteConfig {
pub(crate) out_path: Option<PathBuf>,
pub(crate) format: OutFormat,
pub(crate) overwrite: bool,
pub(crate) compression: Option<ParquetCompression>,
pub(crate) 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 are private and validated by new; read them via
the accessor methods. This prevents constructing a config that bypasses path,
extension, and compression-level 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.
Sourcepub fn out_path(&self) -> Option<&Path>
pub fn out_path(&self) -> Option<&Path>
The validated output path, or None to write CSV to stdout.
Sourcepub const fn compression(&self) -> Option<ParquetCompression>
pub const fn compression(&self) -> Option<ParquetCompression>
The configured Parquet compression codec, if any.
Sourcepub const fn compression_level(&self) -> Option<u32>
pub const fn compression_level(&self) -> Option<u32>
The configured Parquet compression level, if any.
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 UnsafeUnpin 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