pub struct NetcdfWriter { /* private fields */ }Expand description
NetCDF-3 file writer.
Because netcdf3::FileWriter is !Send (uses Rc internally), we cannot
store it as a field on a Send + Sync struct. Instead we buffer frame data
in memory and materialise the FileWriter only inside close_file(), where
it is created, used, and dropped within a single method call. The same
approach is used for read_file() with FileReader.
Implementations§
Source§impl NetcdfWriter
impl NetcdfWriter
Trait Implementations§
Source§impl NDFileWriter for NetcdfWriter
impl NDFileWriter for NetcdfWriter
Source§fn close_file(&mut self) -> ADResult<()>
fn close_file(&mut self) -> ADResult<()>
Close the open file — for netCDF this is where the whole file is
written, from the frames write_file buffered.
The buffer belongs to the finalizer for the same reason current_path
is taken up front: every write below is fallible, and frames of a file
that will never exist must not stay resident until some later
open_file happens to clear them.
Source§fn writes_incrementally(&self) -> bool
fn writes_incrementally(&self) -> bool
netCDF-3 keeps the record count in the header, and netcdf3 0.6 fixes
it when FileWriter::set_def writes that header: set_def may be
called once, write_record_* rejects any index past the count it
declared, and FileWriter::open truncates rather than appends. The
whole file therefore has to be written from close_file, so a frame is
not on disk when write_file returns.
fn open_file( &mut self, path: &Path, mode: NDFileMode, _array: &NDArray, ) -> ADResult<()>
fn write_file(&mut self, array: &NDArray) -> ADResult<()>
fn read_file(&mut self) -> ADResult<NDArray>
fn supports_multiple_arrays(&self) -> bool
Source§fn set_num_capture(&mut self, _n: usize)
fn set_num_capture(&mut self, _n: usize)
NDFileNumCapture)
before the next open_file. A writer whose on-disk layout depends on
the capture target (e.g. HDF5 chunk sizing, C calculateAttributeChunking)
uses it; the default ignores it.Auto Trait Implementations§
impl Freeze for NetcdfWriter
impl RefUnwindSafe for NetcdfWriter
impl Send for NetcdfWriter
impl Sync for NetcdfWriter
impl Unpin for NetcdfWriter
impl UnsafeUnpin for NetcdfWriter
impl UnwindSafe for NetcdfWriter
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