struct WriteContext {
rx: Receiver<(ReadStatData, WriteConfig, usize)>,
reader: JoinHandle<Result<(), ReadStatError>>,
wc: WriteConfig,
input_path: PathBuf,
var_count: i32,
vars: Arc<BTreeMap<i32, ReadStatVarMetadata>>,
schema: Arc<Schema>,
}Expand description
State shared by every write strategy in run_data.
Owns the channel receiver and the reader-thread handle so it can move into
whichever strategy runs. The metadata fields (var_count, vars, schema)
and input_path are used to emit a valid empty file when the input has zero
rows; the SQL path ignores them.
Fields§
§rx: Receiver<(ReadStatData, WriteConfig, usize)>Receiver of parsed chunks from the reader thread.
reader: JoinHandle<Result<(), ReadStatError>>Handle to the reader thread, joined before output is finalized.
wc: WriteConfigOutput configuration (path, format, compression).
input_path: PathBufInput file path, for the write summary.
var_count: i32Variable count, for emitting an empty file on zero rows.
vars: Arc<BTreeMap<i32, ReadStatVarMetadata>>Variable metadata, for emitting an empty file on zero rows.
schema: Arc<Schema>Arrow schema, for emitting an empty file on zero rows.
Auto Trait Implementations§
impl Freeze for WriteContext
impl !RefUnwindSafe for WriteContext
impl Send for WriteContext
impl Sync for WriteContext
impl Unpin for WriteContext
impl UnsafeUnpin for WriteContext
impl !UnwindSafe for WriteContext
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
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